mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 19:40:04 +00:00
Make the fallback() FormulaAI action transfer control only until end of turn
This commit is contained in:
parent
733e8db8a2
commit
30447aa7f7
@ -79,6 +79,7 @@ playsingle_controller::playsingle_controller(const config& level,
|
||||
, turn_data_(replay_sender_, network_reader_)
|
||||
, end_turn_(END_TURN_NONE)
|
||||
, skip_next_turn_(false)
|
||||
, ai_fallback_(false)
|
||||
, replay_()
|
||||
{
|
||||
hotkey_handler_.reset(new hotkey_handler(*this, saved_game_)); //upgrade hotkey handler to the sp (whiteboard enabled) version
|
||||
@ -549,6 +550,7 @@ void playsingle_controller::play_ai_turn()
|
||||
catch (fallback_ai_to_human_exception&) {
|
||||
current_team().make_human();
|
||||
player_type_changed_ = true;
|
||||
ai_fallback_ = true;
|
||||
}
|
||||
}
|
||||
catch(...) {
|
||||
@ -642,6 +644,11 @@ void playsingle_controller::sync_end_turn()
|
||||
|
||||
assert(end_turn_ == END_TURN_SYNCED);
|
||||
skip_next_turn_ = false;
|
||||
|
||||
if(ai_fallback_) {
|
||||
current_team().make_ai();
|
||||
ai_fallback_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
void playsingle_controller::update_viewing_player()
|
||||
|
@ -94,7 +94,7 @@ protected:
|
||||
END_TURN_SYNCED,
|
||||
};
|
||||
END_TURN_STATE end_turn_;
|
||||
bool skip_next_turn_;
|
||||
bool skip_next_turn_, ai_fallback_;
|
||||
std::unique_ptr<replay_controller> replay_;
|
||||
void linger();
|
||||
void sync_end_turn() override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user