diff options
author | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-07-12 22:55:29 +0200 |
---|---|---|
committer | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-07-12 22:55:29 +0200 |
commit | 6c5a42737ff51f7088a672ef2ca2be777597eb7b (patch) | |
tree | 83bdaf5847365339c3ebeab8d5e3c9d32ec542e8 /source/cPlayer.cpp | |
parent | cleaned the svn:ignore property a little bit (diff) | |
download | cuberite-6c5a42737ff51f7088a672ef2ca2be777597eb7b.tar cuberite-6c5a42737ff51f7088a672ef2ca2be777597eb7b.tar.gz cuberite-6c5a42737ff51f7088a672ef2ca2be777597eb7b.tar.bz2 cuberite-6c5a42737ff51f7088a672ef2ca2be777597eb7b.tar.lz cuberite-6c5a42737ff51f7088a672ef2ca2be777597eb7b.tar.xz cuberite-6c5a42737ff51f7088a672ef2ca2be777597eb7b.tar.zst cuberite-6c5a42737ff51f7088a672ef2ca2be777597eb7b.zip |
Diffstat (limited to 'source/cPlayer.cpp')
-rw-r--r-- | source/cPlayer.cpp | 2 |
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 ); |