diff options
author | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-19 17:16:35 +0100 |
---|---|---|
committer | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-19 17:16:35 +0100 |
commit | 0e6107bfddeb6265f7a20076cdb86d5fa1aaa905 (patch) | |
tree | abbc672f049128c6821b2f0c12cd49692bcaaf8f /src/Entities/Player.cpp | |
parent | fixed visual studio compile flags (diff) | |
parent | Merge pull request #450 from mc-server/redstonefixes (diff) | |
download | cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.gz cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.bz2 cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.lz cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.xz cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.zst cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.zip |
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r-- | src/Entities/Player.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 7e7d77433..ca0d625e2 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -65,6 +65,8 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) , m_IsSubmerged(false) , m_IsFlying(false) , m_CanFly(false) + , m_IsFishing(false) + , m_FloaterID(-1) , m_EatingFinishTick(-1) , m_IsChargingBow(false) , m_BowCharge(0) @@ -1500,6 +1502,24 @@ bool cPlayer::LoadFromDisk() //SetExperience(root.get("experience", 0).asInt()); m_GameMode = (eGameMode) root.get("gamemode", eGameMode_NotSet).asInt(); + + if (m_GameMode == eGameMode_Creative) + { + m_CanFly = true; + } + else if (m_GameMode == eGameMode_NotSet) + { + cWorld * World = cRoot::Get()->GetWorld(GetLoadedWorldName()); + if (World == NULL) + { + World = cRoot::Get()->GetDefaultWorld(); + } + + if (World->GetGameMode() == eGameMode_Creative) + { + m_CanFly = true; + } + } m_Inventory.LoadFromJson(root["inventory"]); |