Skip to content
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

Turn dialog shown for dead sides #4240

Closed
jostephd opened this issue Aug 16, 2019 · 1 comment
Closed

Turn dialog shown for dead sides #4240

jostephd opened this issue Aug 16, 2019 · 1 comment
Assignees
Labels
Confirmed Issues that have been successfully reproduced by at least one developer. Engine General game engine issues that do not fit in any other category. Regression Issues that were not present in previous releases.

Comments

@jostephd
Copy link
Member

#4188 moved the show_turn_dialog function call up the callstack.

#4230 fixed a regression in #4188. This issue is about another potential regression.

Before #4188, the code was:

if (!skip_next_turn_) {
end_turn_ = END_TURN_NONE;
}
if(replay_controller_.get() != nullptr) {
init_side_done_now_ = false;
REPLAY_RETURN res = replay_controller_->play_side_impl();
if(res == REPLAY_FOUND_END_TURN) {
end_turn_ = END_TURN_SYNCED;
}
if (player_type_changed_) {
replay_controller_.reset();
}
} else if((current_team().is_local_human() && current_team().is_proxy_human())) {
LOG_NG << "is human...\n";
// If a side is dead end the turn, but play at least side=1's
// turn in case all sides are dead
if (gamestate().board_.side_units(current_side()) == 0 && !(gamestate().board_.units().empty() && current_side() == 1)) {
end_turn_ = END_TURN_REQUIRED;
}
before_human_turn();
if (end_turn_ == END_TURN_NONE) {
play_human_turn();
}

void playsingle_controller::play_human_turn() {
show_turn_dialog();

It seems that if the condition on line 382 is true, or skip_next_turn_ is true and end_turn_ != END_TURN_NONE at entry to play_side_impl, then a turn dialog would not have been shown before #4188, but would be shown now. I have not tested this, only reviewed the source code.

skip_next_turn_ can only be set to true by the debug :change_level command and by the Lua wesnoth.end_turn function.

@jostephd jostephd added Regression Issues that were not present in previous releases. Engine General game engine issues that do not fit in any other category. labels Aug 16, 2019
@jostephd jostephd self-assigned this Aug 16, 2019
@jostephd jostephd added the Confirmed Issues that have been successfully reproduced by at least one developer. label Aug 16, 2019
@jostephd
Copy link
Member Author

jostephd commented Aug 16, 2019

Confirmed by making HttT S1 side 2 controller=human, starting HttT, killing the blue leader, and ending side 1's turn. I get a turn dialog for side 2 even though he has no units. That doesn't happen with a 1.14 tree from before #4188.

@jostephd jostephd changed the title Possible regression in #4188: turn dialog shown for dead sides? Turn dialog shown for dead sides Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed Issues that have been successfully reproduced by at least one developer. Engine General game engine issues that do not fit in any other category. Regression Issues that were not present in previous releases.
Projects
None yet
Development

No branches or pull requests

1 participant