summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2013-12-19 17:16:35 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2013-12-19 17:16:35 +0100
commit0e6107bfddeb6265f7a20076cdb86d5fa1aaa905 (patch)
treeabbc672f049128c6821b2f0c12cd49692bcaaf8f /src/Entities/Player.cpp
parentfixed visual studio compile flags (diff)
parentMerge pull request #450 from mc-server/redstonefixes (diff)
downloadcuberite-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.cpp20
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"]);