summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2014-11-24 13:52:27 +1000
committerCraig Robbins <kde.psych@gmail.com>2014-11-26 00:49:54 +1000
commit26cf98ccfc70909be916d29f0cc480f6929cbb08 (patch)
treedb4b767db03dabfde84907df6fc48876585a7759 /src
parent5413ed11955a5b8a09625b2df1c28fb18c99c296 (diff)
downloadminetest-26cf98ccfc70909be916d29f0cc480f6929cbb08.tar.gz
minetest-26cf98ccfc70909be916d29f0cc480f6929cbb08.tar.bz2
minetest-26cf98ccfc70909be916d29f0cc480f6929cbb08.zip
Fix client "double saving" simple singleplayer local maps
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp4
-rw-r--r--src/client.h1
-rw-r--r--src/game.cpp8
3 files changed, 9 insertions, 4 deletions
diff --git a/src/client.cpp b/src/client.cpp
index c1806df99..074ac9ba6 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -219,6 +219,7 @@ Client::Client(
IrrlichtDevice *device,
const char *playername,
std::string password,
+ bool is_simple_singleplayer_game,
MapDrawControl &control,
IWritableTextureSource *tsrc,
IWritableShaderSource *shsrc,
@@ -280,7 +281,8 @@ Client::Client(
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"
+ DIR_DELIM + "server_" + g_settings->get("address")
+ "_" + g_settings->get("remote_port");
diff --git a/src/client.h b/src/client.h
index e41410f14..e871dee93 100644
--- a/src/client.h
+++ b/src/client.h
@@ -305,6 +305,7 @@ public:
IrrlichtDevice *device,
const char *playername,
std::string password,
+ bool is_simple_singleplayer_game,
MapDrawControl &control,
IWritableTextureSource *tsrc,
IWritableShaderSource *shsrc,
diff --git a/src/game.cpp b/src/game.cpp
index 4518c1612..70d526a9d 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -2103,9 +2103,11 @@ bool Game::connectToServer(const std::string &playername,
return false;
}
- client = new Client(device, playername.c_str(), password, *draw_control,
- texture_src, shader_src, itemdef_manager, nodedef_manager, sound,
- eventmgr, connect_address.isIPv6());
+ client = new Client(device,
+ playername.c_str(), password, simple_singleplayer_mode,
+ *draw_control, texture_src, shader_src,
+ itemdef_manager, nodedef_manager, sound, eventmgr,
+ connect_address.isIPv6());
if (!client)
return false;