mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-10 16:36:49 +00:00
use events::command_disabler in synced context
During the synced context we are in a state 'during an execution of an event/action' that the savefile format cannot cover. So we use command_disabler to prevent saving.
This commit is contained in:
parent
5ffd7aebfd
commit
a8dc92f5d6
@ -287,19 +287,19 @@ config synced_context::ask_server(const std::string &name, const mp_sync::user_c
|
||||
}
|
||||
|
||||
set_scontext_synced::set_scontext_synced(const std::string& commandname)
|
||||
: new_rng_(synced_context::get_rng_for(commandname)), new_checkup_(recorder.get_last_real_command().child_or_add("checkup"))
|
||||
: new_rng_(synced_context::get_rng_for(commandname)), new_checkup_(recorder.get_last_real_command().child_or_add("checkup")), disabler_()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
set_scontext_synced::set_scontext_synced()
|
||||
: new_rng_(synced_context::get_rng_for("")), new_checkup_(recorder.get_last_real_command().child_or_add("checkup"))
|
||||
: new_rng_(synced_context::get_rng_for("")), new_checkup_(recorder.get_last_real_command().child_or_add("checkup")), disabler_()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
set_scontext_synced::set_scontext_synced(int number)
|
||||
: new_rng_(synced_context::get_rng_for("")), new_checkup_(recorder.get_last_real_command().child_or_add("checkup" + boost::lexical_cast<std::string>(number)))
|
||||
: new_rng_(synced_context::get_rng_for("")), new_checkup_(recorder.get_last_real_command().child_or_add("checkup" + boost::lexical_cast<std::string>(number))), disabler_()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "random_new.hpp"
|
||||
#include "random_new_synced.hpp"
|
||||
#include "generic_event.hpp"
|
||||
#include "mouse_handler_base.hpp"
|
||||
#include <boost/shared_ptr.hpp>
|
||||
class config;
|
||||
|
||||
@ -150,6 +151,7 @@ private:
|
||||
boost::shared_ptr<random_new::rng> new_rng_;
|
||||
checkup* old_checkup_;
|
||||
synced_checkup new_checkup_;
|
||||
events::command_disabler disabler_;
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user