diff --git network/network_cmd_ingame.cc network/network_cmd_ingame.cc index a20f0e3b76..8485f197e0 100644 --- network/network_cmd_ingame.cc +++ network/network_cmd_ingame.cc @@ -1051,7 +1051,7 @@ network_broadcast_world_command_t* nwc_tool_t::clone(karte_t *welt) } // do not open dialog windows across network - if ( init ? tool->is_init_network_save() : tool->is_work_network_save() ){ + if ( init ? tool->is_init_network_safe() : tool->is_work_network_safe() ){ // no reason to send request over network return NULL; } diff --git script/api/api_command.cc script/api/api_command.cc index b79d0f0ed5..1bcde8b582 100644 --- script/api/api_command.cc +++ script/api/api_command.cc @@ -210,7 +210,7 @@ SQInteger param::push(HSQUIRRELVM vm, call_tool_work v) uint8 flags = tool->flags; // might be reset by init() // call init before work (but check network safety) - if (!tool->is_init_network_save()) { + if (!tool->is_init_network_safe()) { return sq_raise_error(vm, "Initializing tool has side effects"); } if (!tool->init(player)) { @@ -219,7 +219,7 @@ SQInteger param::push(HSQUIRRELVM vm, call_tool_work v) // set flags tool->flags = flags; // test work - if (tool->is_work_network_save() || (!v.twoclick && tool->is_work_here_network_save(player, v.start))) { + if (tool->is_work_network_safe() || (!v.twoclick && tool->is_work_here_network_safe(player, v.start))) { return sq_raise_error(vm, "Tool has no effects"); } // two-click tool @@ -227,7 +227,7 @@ SQInteger param::push(HSQUIRRELVM vm, call_tool_work v) if (dynamic_cast(tool)==NULL) { return sq_raise_error(vm, "Cannot call this tool with two coordinates"); } - if (!tool->is_work_here_network_save(player, v.start)) { + if (!tool->is_work_here_network_safe(player, v.start)) { return sq_raise_error(vm, "First click has side effects"); } } diff --git siminteraction.cc siminteraction.cc index 49e91474f3..74422fcaf7 100644 --- siminteraction.cc +++ siminteraction.cc @@ -81,7 +81,7 @@ void interaction_t::move_cursor( const event_t &ev ) if (!tool->move_has_effects()) { is_dragging = false; } - else if( !env_t::networkmode || tool->is_move_network_save(world->get_active_player())) { + else if( !env_t::networkmode || tool->is_move_network_safe(world->get_active_player())) { tool->flags = event_get_last_control_shift() | tool_t::WFL_LOCAL; if(tool->check_pos( world->get_active_player(), zeiger->get_pos() )==NULL) { if( ev.button_state == 0 ) { diff --git simmenu.cc simmenu.cc index 0f705a4f1e..60793d204a 100644 --- simmenu.cc +++ simmenu.cc @@ -68,9 +68,9 @@ public: tool_dummy_t() : tool_t(dummy_id) {} bool init(player_t*) OVERRIDE { return false; } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } - bool is_move_network_save(player_t*) const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } + bool is_move_network_safe(player_t*) const OVERRIDE { return true; } }; tool_t *tool_t::dummy = new tool_dummy_t(); @@ -1066,14 +1066,14 @@ bool two_click_tool_t::is_first_click() const } -bool two_click_tool_t::is_work_here_network_save(player_t *player, koord3d pos ) +bool two_click_tool_t::is_work_here_network_safe(player_t *player, koord3d pos ) { if( !is_first_click() ) { return false; } const char *error = ""; //default: nosound uint8 value = is_valid_pos( player, pos, error, koord3d::invalid ); - DBG_MESSAGE("two_click_tool_t::is_work_here_network_save", "Position %s valid=%d", pos.get_str(), value ); + DBG_MESSAGE("two_click_tool_t::is_work_here_network_safe", "Position %s valid=%d", pos.get_str(), value ); if( value == 0 ) { // cannot work here at all -> safe return true; diff --git simmenu.h simmenu.h index 96bd9d4535..82f0ba924b 100644 --- simmenu.h +++ simmenu.h @@ -273,14 +273,14 @@ public: virtual bool is_selected() const; // when true, local execution would do no harm - virtual bool is_init_network_save() const { return false; } - virtual bool is_move_network_save(player_t *) const { return true; } + virtual bool is_init_network_safe() const { return false; } + virtual bool is_move_network_safe(player_t *) const { return true; } - // if is_work_network_save()==false - // and is_work_here_network_save(...)==false + // if is_work_network_safe()==false + // and is_work_here_network_safe(...)==false // then work-command is sent over network - virtual bool is_work_network_save() const { return false; } - virtual bool is_work_here_network_save(player_t *, koord3d) { return false; } + virtual bool is_work_network_safe() const { return false; } + virtual bool is_work_here_network_safe(player_t *, koord3d) { return false; } // will draw a dark frame, if selected virtual void draw_after(scr_coord pos, bool dirty) const; @@ -369,7 +369,7 @@ public: char const* move(player_t*, uint16 /* buttonstate */, koord3d) OVERRIDE; bool move_has_effects() const OVERRIDE { return true; } - bool is_work_here_network_save(player_t *, koord3d) OVERRIDE; + bool is_work_here_network_safe(player_t *, koord3d) OVERRIDE; /** * @returns true if cleanup() needs to be called before another tool can be executed @@ -444,8 +444,8 @@ public: tool_selector_t *get_tool_selector() const { return tool_selector; } image_id get_icon(player_t*) const OVERRIDE; bool is_selected() const OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } // show this toolbar bool init(player_t*) OVERRIDE; // close this toolbar diff --git simtool-dialogs.h simtool-dialogs.h index 6767d06d77..34d6a26dbc 100644 --- simtool-dialogs.h +++ simtool-dialogs.h @@ -65,8 +65,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_mainhelp); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open info/quit dialog @@ -80,8 +80,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_optionen_gui_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open minimap @@ -95,8 +95,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_reliefmap); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open line management @@ -113,8 +113,8 @@ public: return false; } bool exit(player_t* const player) OVERRIDE{ destroy_win(win_get_magic(magic_line_management_t + player->get_player_nr())); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open messages @@ -128,8 +128,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_messageframe); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open finance window @@ -143,8 +143,8 @@ public: return false; } bool exit(player_t* const player) OVERRIDE{ destroy_win(magic_finances_t + player->get_player_nr()); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open player dialog @@ -158,8 +158,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_ki_kontroll_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open display options @@ -173,8 +173,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_color_gui_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open sound dialog @@ -188,8 +188,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_sound_kontroll_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open language dialog @@ -203,8 +203,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_sprachengui_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // open player color dialog @@ -218,8 +218,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_farbengui_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // jump to position dialog @@ -233,8 +233,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_jump); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // load game dialog @@ -257,7 +257,7 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_load_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } }; // save game dialog @@ -271,7 +271,7 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_save_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } }; // open scripted-tools dialog @@ -286,7 +286,7 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_load_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } }; // open scenario dialog @@ -309,7 +309,7 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_load_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } }; // open scenario info dialog @@ -324,7 +324,7 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_scenario_info); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } }; /* open the list of halt */ @@ -338,8 +338,8 @@ public: return false; } bool exit(player_t* player) OVERRIDE{ destroy_win(magic_halt_list_t + player->get_player_nr()); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open the list of vehicle */ @@ -354,8 +354,8 @@ public: return false; } bool exit(player_t* const player) OVERRIDE{ destroy_win(magic_convoi_list + player->get_player_nr()); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open the list of depots */ @@ -370,8 +370,8 @@ public: return false; } bool exit(player_t* player) OVERRIDE{ destroy_win(magic_depotlist + player->get_player_nr()); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open the list of vehicles */ @@ -385,8 +385,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_vehiclelist); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open the list of towns */ @@ -400,8 +400,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_citylist_frame_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open the list of goods */ @@ -415,8 +415,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_goodslist); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open the list of factories */ @@ -430,8 +430,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_factorylist); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open the list of attraction */ @@ -445,8 +445,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_curiositylist); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* factory building dialog */ @@ -462,8 +462,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_edit_factory); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* attraction building dialog */ @@ -479,8 +479,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_edit_attraction); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* house building dialog */ @@ -496,8 +496,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_edit_house); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* tree placing dialog */ @@ -514,8 +514,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_edit_tree); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; // to increase map-size @@ -546,8 +546,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_labellist); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open climate settings */ @@ -593,8 +593,8 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_server_frame_t); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; /* open themes selector settings */ @@ -608,7 +608,7 @@ public: return false; } bool exit(player_t*) OVERRIDE{ destroy_win(magic_themes); return false; } - bool is_init_network_save() const OVERRIDE{ return true; } - bool is_work_network_save() const OVERRIDE{ return true; } + bool is_init_network_safe() const OVERRIDE{ return true; } + bool is_work_network_safe() const OVERRIDE{ return true; } }; #endif diff --git simtool-scripted.h simtool-scripted.h index a528167537..9aeea287b6 100644 --- simtool-scripted.h +++ simtool-scripted.h @@ -85,8 +85,8 @@ protected: public: tool_exec_script_t(const scripted_tool_info_t *info = NULL); /// is network-safe, as calls to work-commands will be properly handled in network mode - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } bool init(player_t* player) OVERRIDE; bool exit(player_t* player) OVERRIDE; @@ -102,8 +102,8 @@ class tool_exec_two_click_script_t : public two_click_tool_t, public exec_script public: tool_exec_two_click_script_t(const scripted_tool_info_t *info = NULL); /// is network-safe, as calls to work-commands will be properly handled in network mode - bool is_work_network_save() const OVERRIDE { return true; } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } bool init(player_t* player) OVERRIDE; bool exit(player_t* player) OVERRIDE; diff --git simtool.h simtool.h index 59535bd7e2..fbf7dc9269 100644 --- simtool.h +++ simtool.h @@ -49,8 +49,8 @@ public: tool_query_t() : tool_t(TOOL_QUERY | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Abfrage"); } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; @@ -62,7 +62,7 @@ public: tool_remover_t() : tool_t(TOOL_REMOVER | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Abriss"); } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; // alter land height tools @@ -86,12 +86,12 @@ public: char const* move(player_t*, uint16 /* buttonstate */, koord3d) OVERRIDE; bool move_has_effects() const OVERRIDE { return true; } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } /** * work() is only called when not dragging * if work() is called with is_dragging==true then is_dragging is reset */ - bool is_work_network_save() const OVERRIDE { return is_dragging;} + bool is_work_network_safe() const OVERRIDE { return is_dragging;} /** * @return true if this tool operates over the grid, not the map tiles. @@ -134,7 +134,7 @@ public: */ static const char *tool_set_slope_work( player_t *player, koord3d pos, int slope, bool old_slope_compatibility, bool just_check = false); char const* get_tooltip(player_t const*) const OVERRIDE { return tooltip_with_price("Built artifical slopes", welt->get_settings().cst_set_slope); } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } char const* check_pos(player_t*, koord3d) OVERRIDE; char const* work(player_t* const player, koord3d const k) OVERRIDE { return tool_set_slope_work(player, k, atoi(default_param), old_slope_compatibility_mode); } }; @@ -143,7 +143,7 @@ class tool_restoreslope_t : public tool_t { public: tool_restoreslope_t() : tool_t(TOOL_RESTORESLOPE | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return tooltip_with_price("Restore natural slope", welt->get_settings().cst_set_slope); } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } char const* check_pos(player_t*, koord3d) OVERRIDE; char const* work(player_t* const player, koord3d const k) OVERRIDE { return tool_setslope_t::tool_set_slope_work(player, k, RESTORE_SLOPE, true); } }; @@ -153,7 +153,7 @@ public: tool_marker_t() : kartenboden_tool_t(TOOL_MARKER | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return tooltip_with_price("Marker", welt->get_settings().cst_buy_land); } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; class tool_clear_reservation_t : public tool_t { @@ -163,7 +163,7 @@ public: bool init(player_t*) OVERRIDE; bool exit(player_t*) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; class tool_transformer_t : public kartenboden_tool_t { @@ -176,7 +176,7 @@ public: bool init(player_t*) OVERRIDE; char const* check_pos(player_t*, koord3d) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE { return powerline_wt; } }; @@ -185,7 +185,7 @@ public: tool_add_city_t() : kartenboden_tool_t(TOOL_ADD_CITY | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return tooltip_with_price("Found new city", welt->get_settings().cst_found_city); } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; // buy a house to protect it from renovating @@ -194,7 +194,7 @@ public: tool_buy_house_t() : kartenboden_tool_t(TOOL_BUY_HOUSE | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Haus kaufen"); } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; /************** the following tools need a valid default_param ************************/ @@ -205,7 +205,7 @@ public: char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate( atoi(default_param)>=0 ? "Grow city" : "Shrink city" ); } bool init(player_t*) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; // height change by default_param @@ -216,7 +216,7 @@ public: bool init(player_t*) OVERRIDE; image_id get_icon(player_t *player) const OVERRIDE { return (!env_t::networkmode || player->is_public_service()) ? icon : IMG_EMPTY; } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; // height change by default_param @@ -228,7 +228,7 @@ private: char const* do_work(player_t*, koord3d const&, koord3d const&) OVERRIDE; void mark_tiles(player_t*, koord3d const&, koord3d const&) OVERRIDE; uint8 is_valid_pos(player_t*, koord3d const&, char const*&, koord3d const&) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; class tool_plant_tree_t : public kartenboden_tool_t { @@ -240,7 +240,7 @@ public: char const* move(player_t* const player, uint16 const b, koord3d const k) OVERRIDE; bool move_has_effects() const OVERRIDE { return true; } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; /* only called directly from schedule => no tooltip! @@ -250,16 +250,16 @@ class tool_schedule_add_t : public tool_t { public: tool_schedule_add_t() : tool_t(TOOL_SCHEDULE_ADD | GENERAL_TOOL) {} char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_schedule_ins_t : public tool_t { public: tool_schedule_ins_t() : tool_t(TOOL_SCHEDULE_INS | GENERAL_TOOL) {} char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_build_way_t : public two_click_tool_t { @@ -284,7 +284,7 @@ public: char const* get_default_param(player_t*) const OVERRIDE; bool is_selected() const OVERRIDE; bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE; // remove preview necessary while building elevated ways bool remove_preview_necessary() const OVERRIDE { return !is_first_click() && (desc && (desc->get_styp() == type_elevated && desc->get_wtyp() != air_wt)); } @@ -298,7 +298,7 @@ public: way_desc_t const* get_desc(uint16, bool) const OVERRIDE; image_id get_icon(player_t* const player) const OVERRIDE { return tool_t::get_icon(player); } bool is_selected() const OVERRIDE { return tool_t::is_selected(); } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE { return road_wt; } }; @@ -313,7 +313,7 @@ public: tool_build_bridge_t() : two_click_tool_t(TOOL_BUILD_BRIDGE | GENERAL_TOOL) {} image_id get_icon(player_t*) const OVERRIDE { return grund_t::underground_mode==grund_t::ugm_all ? IMG_EMPTY : icon; } char const* get_tooltip(player_t const*) const OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE; bool remove_preview_necessary() const OVERRIDE { return !is_first_click(); } void rdwr_custom_data(memory_rw_t*) OVERRIDE; @@ -330,7 +330,7 @@ public: tool_build_tunnel_t() : two_click_tool_t(TOOL_BUILD_TUNNEL | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE; char const* check_pos(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE; bool remove_preview_necessary() const OVERRIDE { return !is_first_click(); } bool init(player_t*) OVERRIDE; @@ -348,7 +348,7 @@ public: tool_wayremover_t() : two_click_tool_t(TOOL_WAYREMOVER | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE; image_id get_icon(player_t*) const OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE; }; @@ -372,7 +372,7 @@ public: char const* get_tooltip(player_t const*) const OVERRIDE; bool is_selected() const OVERRIDE; bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE; }; @@ -380,7 +380,7 @@ class tool_remove_wayobj_t : public tool_build_wayobj_t { public: tool_remove_wayobj_t() : tool_build_wayobj_t(TOOL_REMOVE_WAYOBJ | GENERAL_TOOL, false) {} bool is_selected() const OVERRIDE { return tool_t::is_selected(); } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; class tool_build_station_t : public tool_t { @@ -400,7 +400,7 @@ public: char const* move(player_t*, uint16 /* buttonstate */, koord3d) OVERRIDE; bool move_has_effects() const OVERRIDE { return true; } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE; }; @@ -413,7 +413,7 @@ public: tool_rotate_building_t() : tool_t(TOOL_ROTATE_BUILDING | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Rotate Building"); } char const* work(player_t *, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; // builds roadsigns and signals @@ -453,7 +453,7 @@ public: void set_values(player_t *player, uint8 spacing, bool remove, bool replace ); void get_values(player_t *player, uint8 &spacing, bool &remove, bool &replace ); - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } void draw_after(scr_coord, bool dirty) const OVERRIDE; void rdwr_custom_data(memory_rw_t*) OVERRIDE; waytype_t get_waytype() const OVERRIDE; @@ -468,7 +468,7 @@ public: char const* get_tooltip(player_t const*) const OVERRIDE; bool init(player_t*) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } waytype_t get_waytype() const OVERRIDE; }; @@ -486,7 +486,7 @@ public: char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Built random attraction"); } bool init(player_t*) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; /** @@ -505,7 +505,7 @@ public: char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Build land consumer"); } bool init(player_t*) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; class tool_city_chain_t : public kartenboden_tool_t { @@ -514,7 +514,7 @@ public: char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Build city market"); } bool init(player_t*) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; class tool_build_factory_t : public kartenboden_tool_t { @@ -523,14 +523,14 @@ public: char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Build city market"); } bool init(player_t*) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; class tool_link_factory_t : public two_click_tool_t { public: tool_link_factory_t() : two_click_tool_t(TOOL_LINK_FACTORY | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Connect factory"); } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } private: char const* do_work(player_t*, koord3d const&, koord3d const&) OVERRIDE; void mark_tiles(player_t*, koord3d const&, koord3d const&) OVERRIDE {} @@ -546,7 +546,7 @@ public: char const* get_tooltip(player_t const*) const OVERRIDE; bool init(player_t*) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; /* protects map from further change (here because two clicks to confirm it!) */ @@ -558,7 +558,7 @@ public: // deactivate in network mode bool init(player_t *) OVERRIDE { return !env_t::networkmode; } const char *work( player_t *, koord3d ) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; /* add random citycar if no default is set; else add a certain city car */ @@ -567,7 +567,7 @@ public: tool_add_citycar_t() : tool_t(TOOL_ADD_CITYCAR | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Add random citycar"); } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; /* make forest */ @@ -581,7 +581,7 @@ private: char const* do_work(player_t*, koord3d const&, koord3d const&) OVERRIDE; void mark_tiles(player_t*, koord3d const&, koord3d const&) OVERRIDE; uint8 is_valid_pos(player_t*, koord3d const&, char const*&, koord3d const&) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; /* stop moving tool */ @@ -592,7 +592,7 @@ private: public: tool_stop_mover_t() : two_click_tool_t(TOOL_STOP_MOVER | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("replace stop"); } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } private: char const* do_work(player_t*, koord3d const&, koord3d const&) OVERRIDE; @@ -614,7 +614,7 @@ public: char const* move(player_t*, uint16 /* buttonstate */, koord3d) OVERRIDE; bool move_has_effects() const OVERRIDE { return true; } char const* work(player_t*, koord3d) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } }; @@ -626,7 +626,7 @@ private: public: tool_merge_stop_t() : two_click_tool_t(TOOL_MERGE_STOP | GENERAL_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("merge stop"); } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } private: char const* do_work(player_t*, koord3d const&, koord3d const&) OVERRIDE; void mark_tiles(player_t*, koord3d const&, koord3d const&) OVERRIDE; @@ -641,7 +641,7 @@ class tool_error_message_t : public tool_t { public: tool_error_message_t() : tool_t(TOOL_ERROR_MESSAGE | GENERAL_TOOL) {} bool init(player_t*) OVERRIDE { return true; } - bool is_init_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } char const* work(player_t*, koord3d) OVERRIDE { return default_param ? default_param : ""; } }; @@ -662,8 +662,8 @@ public: return false; } bool exit(player_t *s ) OVERRIDE { return init(s); } - bool is_init_network_save() const OVERRIDE { return !env_t::networkmode; } - bool is_work_network_save() const OVERRIDE { return !env_t::networkmode; } + bool is_init_network_safe() const OVERRIDE { return !env_t::networkmode; } + bool is_work_network_safe() const OVERRIDE { return !env_t::networkmode; } }; class tool_fastforward_t : public tool_t { @@ -683,8 +683,8 @@ public: return false; } bool exit(player_t *s ) OVERRIDE { return init(s); } - bool is_init_network_save() const OVERRIDE { return !env_t::networkmode; } - bool is_work_network_save() const OVERRIDE { return !env_t::networkmode; } + bool is_init_network_safe() const OVERRIDE { return !env_t::networkmode; } + bool is_work_network_safe() const OVERRIDE { return !env_t::networkmode; } }; class tool_screenshot_t : public tool_t { @@ -692,8 +692,8 @@ public: tool_screenshot_t() : tool_t(TOOL_SCREENSHOT | SIMPLE_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Screenshot"); } bool init(player_t * ) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; // builds next chain @@ -723,8 +723,8 @@ public: return false; } // since it is handled internally - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; // step one year forward @@ -760,8 +760,8 @@ public: tool_zoom_in_t() : tool_t(TOOL_ZOOM_IN | SIMPLE_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("zooming in"); } bool init( player_t * ) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_zoom_out_t : public tool_t { @@ -769,8 +769,8 @@ public: tool_zoom_out_t() : tool_t(TOOL_ZOOM_OUT | SIMPLE_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("zooming out"); } bool init( player_t * ) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_show_coverage_t : public tool_t { @@ -784,8 +784,8 @@ public: return false; } bool exit(player_t *s ) OVERRIDE { return init(s); } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_show_name_t : public tool_t { @@ -817,8 +817,8 @@ public: welt->set_dirty(); return false; } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_show_grid_t : public tool_t { @@ -832,8 +832,8 @@ public: return false; } bool exit(player_t *s ) OVERRIDE { return init(s); } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_show_trees_t : public tool_t { @@ -843,8 +843,8 @@ public: bool is_selected() const OVERRIDE {return env_t::hide_trees; } bool init( player_t * ) OVERRIDE; bool exit(player_t *s ) OVERRIDE { return init(s); } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_show_houses_t : public tool_t { @@ -863,8 +863,8 @@ public: welt->set_dirty(); return false; } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_show_underground_t : public tool_t { @@ -877,8 +877,8 @@ public: bool init( player_t * ) OVERRIDE; char const* work(player_t*, koord3d) OVERRIDE; bool exit(player_t * ) OVERRIDE { return false; } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_rotate90_t : public tool_t { @@ -888,8 +888,8 @@ public: void draw_after(scr_coord pos, bool dirty) const OVERRIDE; /* may draw a compass on top */ char const* get_tooltip(player_t const*) const OVERRIDE { return env_t::networkmode ? translator::translate("deactivated in online mode") : translator::translate("Rotate map"); } bool init( player_t * ) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return !env_t::networkmode; } - bool is_work_network_save() const OVERRIDE { return !env_t::networkmode; } + bool is_init_network_safe() const OVERRIDE { return !env_t::networkmode; } + bool is_work_network_safe() const OVERRIDE { return !env_t::networkmode; } }; class tool_quit_t : public tool_t { @@ -897,8 +897,8 @@ public: tool_quit_t() : tool_t(TOOL_QUIT | SIMPLE_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Beenden"); } bool init( player_t * ) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; // step size by default_param @@ -921,8 +921,8 @@ public: tool_daynight_level_t() : tool_t(TOOL_DAYNIGHT_LEVEL | SIMPLE_TOOL) {} char const* get_tooltip(player_t const*) const OVERRIDE; bool init(player_t * ) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_vehicle_tooltips_t : public tool_t { @@ -934,8 +934,8 @@ public: welt->set_dirty(); return false; } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_toggle_pax_station_t : public tool_t { @@ -951,7 +951,7 @@ public: return false; } bool exit(player_t *s ) OVERRIDE { return init(s); } - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; class tool_toggle_pedestrians_t : public tool_t { @@ -967,7 +967,7 @@ public: return false; } bool exit(player_t *s ) OVERRIDE { return init(s); } - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; class tool_toggle_reservation_t : public tool_t { @@ -980,8 +980,8 @@ public: welt->set_dirty(); return false; } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_view_owner_t : public tool_t { @@ -994,8 +994,8 @@ public: welt->set_dirty(); return false; } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; class tool_hide_under_cursor_t : public tool_t { @@ -1009,8 +1009,8 @@ public: return false; } bool exit(player_t *s ) OVERRIDE { return init(s); } - bool is_init_network_save() const OVERRIDE { return true; } - bool is_work_network_save() const OVERRIDE { return true; } + bool is_init_network_safe() const OVERRIDE { return true; } + bool is_work_network_safe() const OVERRIDE { return true; } }; /******************************** Internal tools ***********/ @@ -1026,28 +1026,28 @@ public: welt->get_settings().set_traffic_level(level); return false; } - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; class tool_change_convoi_t : public tool_t { public: tool_change_convoi_t() : tool_t(TOOL_CHANGE_CONVOI | SIMPLE_TOOL) {} bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; class tool_change_line_t : public tool_t { public: tool_change_line_t() : tool_t(TOOL_CHANGE_LINE | SIMPLE_TOOL) {} bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; class tool_change_depot_t : public tool_t { public: tool_change_depot_t() : tool_t(TOOL_CHANGE_DEPOT | SIMPLE_TOOL) {} bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; // adds a new player of certain type to the map @@ -1062,7 +1062,7 @@ class tool_change_traffic_light_t : public tool_t { public: tool_change_traffic_light_t() : tool_t(TOOL_CHANGE_TRAFFIC_LIGHT | SIMPLE_TOOL) {} bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; // change city: (dis)allow growth @@ -1070,7 +1070,7 @@ class tool_change_city_t : public tool_t { public: tool_change_city_t() : tool_t(TOOL_CHANGE_CITY | SIMPLE_TOOL) {} bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; // internal tool: rename stuff @@ -1078,7 +1078,7 @@ class tool_rename_t : public tool_t { public: tool_rename_t() : tool_t(TOOL_RENAME | SIMPLE_TOOL) {} bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; // internal tool: send message @@ -1086,7 +1086,7 @@ class tool_add_message_t : public tool_t { public: tool_add_message_t() : tool_t(TOOL_ADD_MESSAGE | SIMPLE_TOOL) {} bool init(player_t*) OVERRIDE; - bool is_init_network_save() const OVERRIDE { return false; } + bool is_init_network_safe() const OVERRIDE { return false; } }; #endif diff --git simworld.cc simworld.cc index 4bef778d8a..b5f96e78d1 100644 --- simworld.cc +++ simworld.cc @@ -3121,7 +3121,7 @@ void karte_t::set_tool( tool_t *tool_in, player_t *player ) return; } // check for password-protected players - if( (!tool_in->is_init_network_save() || !tool_in->is_work_network_save()) && needs_check && + if( (!tool_in->is_init_network_safe() || !tool_in->is_work_network_safe()) && needs_check && !(tool_in->get_id()==(TOOL_CHANGE_PLAYER|SIMPLE_TOOL) || tool_in->get_id()==(TOOL_ADD_MESSAGE|SIMPLE_TOOL)) && player && player->is_locked() ) { // player is currently password protected => request unlock first @@ -3129,7 +3129,7 @@ void karte_t::set_tool( tool_t *tool_in, player_t *player ) return; } tool_in->flags |= event_get_last_control_shift(); - if(!env_t::networkmode || tool_in->is_init_network_save() ) { + if(!env_t::networkmode || tool_in->is_init_network_safe() ) { local_set_tool(tool_in, player); } else { @@ -3147,7 +3147,7 @@ void karte_t::local_set_tool( tool_t *tool_in, player_t * player ) // now call init bool init_result = tool_in->init(player); // for unsafe tools init() must return false - assert(tool_in->is_init_network_save() || !init_result); + assert(tool_in->is_init_network_safe() || !init_result); if (player && init_result && !tool_in->is_scripted()) { @@ -6837,7 +6837,7 @@ void karte_t::network_game_set_pause(bool pause_, uint32 syncsteps_) const char* karte_t::call_work(tool_t *tool, player_t *player, koord3d pos, bool &suspended) { const char *err = NULL; - if (!env_t::networkmode || tool->is_work_network_save() || tool->is_work_here_network_save( player, pos) ) { + if (!env_t::networkmode || tool->is_work_network_safe() || tool->is_work_here_network_safe( player, pos) ) { // do the work tool->flags |= tool_t::WFL_LOCAL; // check allowance by scenario