Fix client "double saving" simple singleplayer local maps

This commit is contained in:
Craig Robbins 2014-11-24 13:52:27 +10:00
parent 5413ed1195
commit 26cf98ccfc
3 changed files with 9 additions and 4 deletions

@ -219,6 +219,7 @@ Client::Client(
IrrlichtDevice *device, IrrlichtDevice *device,
const char *playername, const char *playername,
std::string password, std::string password,
bool is_simple_singleplayer_game,
MapDrawControl &control, MapDrawControl &control,
IWritableTextureSource *tsrc, IWritableTextureSource *tsrc,
IWritableShaderSource *shsrc, IWritableShaderSource *shsrc,
@ -280,7 +281,8 @@ Client::Client(
m_env.addPlayer(player); m_env.addPlayer(player);
} }
if (g_settings->getBool("enable_local_map_saving")) { if (g_settings->getBool("enable_local_map_saving")
&& !is_simple_singleplayer_game) {
const std::string world_path = porting::path_user + DIR_DELIM + "worlds" const std::string world_path = porting::path_user + DIR_DELIM + "worlds"
+ DIR_DELIM + "server_" + g_settings->get("address") + DIR_DELIM + "server_" + g_settings->get("address")
+ "_" + g_settings->get("remote_port"); + "_" + g_settings->get("remote_port");

@ -305,6 +305,7 @@ public:
IrrlichtDevice *device, IrrlichtDevice *device,
const char *playername, const char *playername,
std::string password, std::string password,
bool is_simple_singleplayer_game,
MapDrawControl &control, MapDrawControl &control,
IWritableTextureSource *tsrc, IWritableTextureSource *tsrc,
IWritableShaderSource *shsrc, IWritableShaderSource *shsrc,

@ -2103,9 +2103,11 @@ bool Game::connectToServer(const std::string &playername,
return false; return false;
} }
client = new Client(device, playername.c_str(), password, *draw_control, client = new Client(device,
texture_src, shader_src, itemdef_manager, nodedef_manager, sound, playername.c_str(), password, simple_singleplayer_mode,
eventmgr, connect_address.isIPv6()); *draw_control, texture_src, shader_src,
itemdef_manager, nodedef_manager, sound, eventmgr,
connect_address.isIPv6());
if (!client) if (!client)
return false; return false;