summaryrefslogtreecommitdiffstats
path: root/source/cPlayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cPlayer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp
index ecf6cb145..5ab06fa62 100644
--- a/source/cPlayer.cpp
+++ b/source/cPlayer.cpp
@@ -915,6 +915,7 @@ bool cPlayer::LoadFromDisk()
m_Health = (short)root.get("health", 0 ).asInt();
m_FoodLevel = (short)root.get("food", 0 ).asInt();
+ m_GameMode = (eGameMode) root.get("gamemode", cRoot::Get()->GetDefaultWorld()->GetGameMode()).asInt();
m_Inventory->LoadFromJson(root["inventory"]);
m_CreativeInventory->LoadFromJson(root["creativeinventory"]);
@@ -960,6 +961,7 @@ bool cPlayer::SaveToDisk()
root["health"] = m_Health;
root["food"] = m_FoodLevel;
root["world"] = GetWorld()->GetName();
+ root["gamemode"] = (int) m_GameMode;
Json::StyledWriter writer;
std::string JsonData = writer.write( root );