diff options
author | Mattes D <github@xoft.cz> | 2013-12-19 22:58:49 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-12-19 22:58:49 +0100 |
commit | 39251bccd3a3744859ae2818e9283971a6413326 (patch) | |
tree | fa0adcda98ce23be2d2c77b65c85766a1425ab05 /src/Entities/Player.cpp | |
parent | Merge pull request #449 from mc-server/Fishing_Rod (diff) | |
parent | Fixed PlayerAbilities and creative (diff) | |
download | cuberite-39251bccd3a3744859ae2818e9283971a6413326.tar cuberite-39251bccd3a3744859ae2818e9283971a6413326.tar.gz cuberite-39251bccd3a3744859ae2818e9283971a6413326.tar.bz2 cuberite-39251bccd3a3744859ae2818e9283971a6413326.tar.lz cuberite-39251bccd3a3744859ae2818e9283971a6413326.tar.xz cuberite-39251bccd3a3744859ae2818e9283971a6413326.tar.zst cuberite-39251bccd3a3744859ae2818e9283971a6413326.zip |
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r-- | src/Entities/Player.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 577a33ad9..ca0d625e2 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1502,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"]); |