New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: Client setting gui.start_spectator #7158
Conversation
c77450b
to
30cd9d6
Compare
@@ -67,8 +67,8 @@ static int32 ClickMoneyCheat(int32 p1, int32 p2) | |||
*/ | |||
static int32 ClickChangeCompanyCheat(int32 p1, int32 p2) | |||
{ | |||
while ((uint)p1 < Company::GetPoolSize()) { | |||
if (Company::IsValidID((CompanyID)p1)) { | |||
while ((uint)p1 <= COMPANY_SPECTATOR) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's wrong, you should still check Company::GetPoolSize(), but you can add something to the test
src/toolbar_gui.cpp
Outdated
} else { | ||
*list->Append() = new DropDownListStringItem(STR_NETWORK_TOOLBAR_LIST_SPECTATOR, CTMN_SPECTATOR, false); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a lot of copy pasting, but maybe no other way
af2ed56
to
02f3bda
Compare
src/company_gui.cpp
Outdated
plane = CWP_MP_C_PWD; | ||
} else { | ||
plane = CWP_MP_C_JOIN; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excessive expansion, plane = local ? CWP_MP_C_PWD : CWP_MP_C_JOIN;
would be fine, and similar for the block above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should not touch economy.cpp and bankruptcy handling
43ee27c
to
bb1c94d
Compare
5e94b8c
to
9ec1d48
Compare
Activates a spectator slot in single player and initiate games as a spectator
9ec1d48
to
2b95f53
Compare
I fail to see the usecase for this behavior. Why would I want to be a spectator in a SinglePlayer game? Feels like an anti-pattern. And given the PR does not argue why it should be added, going to close the PR. From a short chat on IRC, I understand it is to watch the AI do its thing. I don't see how it is useful to change so many lines of code for a very low usercount that will ever use it that way. So if that is the argument, I am still going to close the PR. Sorry, not every feature can make it into OpenTTD :) But thank you for your contribution nevertheless! Feel free to rebuttal. But at always, do this with new arguments. Tnx! |
This pull request has been automatically marked as stale because it has not had any activity in the last month. |
Activates a spectator slot in single player and initiate games as a spectator