summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-19 21:53:47 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-19 21:53:47 +0100
commit03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce (patch)
tree82dd75c70052b9b32781a589b7d2cee13faa237f /src/Entities
parentFixed 1.7 arm swing animation (diff)
downloadcuberite-03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce.tar
cuberite-03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce.tar.gz
cuberite-03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce.tar.bz2
cuberite-03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce.tar.lz
cuberite-03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce.tar.xz
cuberite-03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce.tar.zst
cuberite-03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Player.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 7e7d77433..bb19bcce9 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1500,6 +1500,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"]);