summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authortycho <tycho@hanoverdesktop>2013-12-20 01:13:04 +0100
committertycho <tycho@hanoverdesktop>2013-12-20 01:13:04 +0100
commit7735a956f06821e30116df808f94801b5fbd19e6 (patch)
tree6c9c9c0b7484d1dd7343ba05c9b54b098e8104fd /src/Entities/Player.cpp
parentfixed D9025 (diff)
parentMerge pull request #450 from mc-server/redstonefixes (diff)
downloadcuberite-7735a956f06821e30116df808f94801b5fbd19e6.tar
cuberite-7735a956f06821e30116df808f94801b5fbd19e6.tar.gz
cuberite-7735a956f06821e30116df808f94801b5fbd19e6.tar.bz2
cuberite-7735a956f06821e30116df808f94801b5fbd19e6.tar.lz
cuberite-7735a956f06821e30116df808f94801b5fbd19e6.tar.xz
cuberite-7735a956f06821e30116df808f94801b5fbd19e6.tar.zst
cuberite-7735a956f06821e30116df808f94801b5fbd19e6.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"]);