move victory_when_enemies_defeated around
This commit is contained in:
parent
f1e6a0e0b1
commit
a1286479f4
4 changed files with 9 additions and 9 deletions
|
@ -59,6 +59,8 @@ game_state::game_state(const config& level, play_controller& pc)
|
|||
, player_number_(level["playing_team"].to_int() + 1)
|
||||
, next_player_number_(level["next_player_number"].to_int(player_number_ + 1))
|
||||
, do_healing_(level["do_healing"].to_bool(false))
|
||||
, victory_when_enemies_defeated_(level["victory_when_enemies_defeated"].to_bool(true))
|
||||
, remove_from_carryover_on_defeat_(level["remove_from_carryover_on_defeat"].to_bool(true))
|
||||
, server_request_number_(level["server_request_number"].to_int())
|
||||
{
|
||||
lua_kernel_->load_core();
|
||||
|
@ -225,6 +227,8 @@ void game_state::write(config& cfg) const
|
|||
}
|
||||
cfg["server_request_number"] = server_request_number_;
|
||||
cfg["do_healing"] = do_healing_;
|
||||
cfg["victory_when_enemies_defeated"] = victory_when_enemies_defeated_;
|
||||
cfg["remove_from_carryover_on_defeat"] = remove_from_carryover_on_defeat_;
|
||||
//Call the lua save_game functions
|
||||
lua_kernel_->save_game(cfg);
|
||||
|
||||
|
|
|
@ -61,6 +61,8 @@ public:
|
|||
int next_player_number_;
|
||||
/** True if healing should be done at the beginning of the next side turn */
|
||||
bool do_healing_;
|
||||
bool victory_when_enemies_defeated_;
|
||||
bool remove_from_carryover_on_defeat_;
|
||||
|
||||
std::optional<end_level_data> end_level_data_;
|
||||
// used to sync with the mpserver
|
||||
|
|
|
@ -97,8 +97,6 @@ static void copy_persistent(const config& src, config& dst)
|
|||
static const std::set<std::string> attrs {
|
||||
"description",
|
||||
"name",
|
||||
"victory_when_enemies_defeated",
|
||||
"remove_from_carryover_on_defeat",
|
||||
"disallow_recall",
|
||||
"experience_modifier",
|
||||
"require_scenario",
|
||||
|
@ -166,8 +164,6 @@ play_controller::play_controller(const config& level, saved_game& state_of_game,
|
|||
, did_tod_sound_this_turn_(false)
|
||||
, map_start_()
|
||||
, start_faded_(start_faded)
|
||||
, victory_when_enemies_defeated_(level["victory_when_enemies_defeated"].to_bool(true))
|
||||
, remove_from_carryover_on_defeat_(level["remove_from_carryover_on_defeat"].to_bool(true))
|
||||
, victory_music_()
|
||||
, defeat_music_()
|
||||
, scope_(hotkey::scope_game)
|
||||
|
@ -988,7 +984,7 @@ void play_controller::check_victory()
|
|||
found_network_player,
|
||||
invalidate_all,
|
||||
not_defeated,
|
||||
remove_from_carryover_on_defeat_
|
||||
gamestate().remove_from_carryover_on_defeat_
|
||||
);
|
||||
|
||||
if(invalidate_all) {
|
||||
|
@ -1006,11 +1002,11 @@ void play_controller::check_victory()
|
|||
}
|
||||
}
|
||||
|
||||
DBG_EE << "victory_when_enemies_defeated: " << victory_when_enemies_defeated_;
|
||||
DBG_EE << "victory_when_enemies_defeated: " << gamestate().victory_when_enemies_defeated_;
|
||||
DBG_EE << "found_player: " << found_player;
|
||||
DBG_EE << "found_network_player: " << found_network_player;
|
||||
|
||||
if(!victory_when_enemies_defeated_ && (found_player || found_network_player)) {
|
||||
if(!gamestate().victory_when_enemies_defeated_ && (found_player || found_network_player)) {
|
||||
// This level has asked not to be ended by this condition.
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -416,8 +416,6 @@ private:
|
|||
*/
|
||||
void check_next_scenario_is_known();
|
||||
|
||||
bool victory_when_enemies_defeated_;
|
||||
bool remove_from_carryover_on_defeat_;
|
||||
std::vector<std::string> victory_music_;
|
||||
std::vector<std::string> defeat_music_;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue