summaryrefslogtreecommitdiffstats
path: root/source/Entities/Player.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-02 17:44:55 +0100
committermadmaxoft <github@xoft.cz>2013-11-03 11:59:05 +0100
commit7dc96f04415e4c3a9f59fd6c9c0a20a89023589a (patch)
tree9e23ac0cb210067d710ad533235b6624d07365fe /source/Entities/Player.h
parentUpdated README.md since MCServer development will continue even if people don't donate. (diff)
downloadcuberite-7dc96f04415e4c3a9f59fd6c9c0a20a89023589a.tar
cuberite-7dc96f04415e4c3a9f59fd6c9c0a20a89023589a.tar.gz
cuberite-7dc96f04415e4c3a9f59fd6c9c0a20a89023589a.tar.bz2
cuberite-7dc96f04415e4c3a9f59fd6c9c0a20a89023589a.tar.lz
cuberite-7dc96f04415e4c3a9f59fd6c9c0a20a89023589a.tar.xz
cuberite-7dc96f04415e4c3a9f59fd6c9c0a20a89023589a.tar.zst
cuberite-7dc96f04415e4c3a9f59fd6c9c0a20a89023589a.zip
Diffstat (limited to '')
-rw-r--r--source/Entities/Player.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/Entities/Player.h b/source/Entities/Player.h
index 449a63231..01efa3681 100644
--- a/source/Entities/Player.h
+++ b/source/Entities/Player.h
@@ -4,6 +4,7 @@
#include "Pawn.h"
#include "../Inventory.h"
#include "../Defines.h"
+#include "../World.h"
@@ -99,6 +100,9 @@ public:
/// Returns the current gamemode. Partly OBSOLETE, you should use IsGameModeXXX() functions wherever applicable
eGameMode GetGameMode(void) const { return m_GameMode; }
+ /// Returns the current effective gamemode (inherited gamemode is resolved before returning)
+ eGameMode GetEffectiveGameMode(void) const { return (m_GameMode == gmNotSet) ? m_World->GetGameMode() : m_GameMode; }
+
/** Sets the gamemode for the player.
The gamemode may be gmNotSet, in that case the player inherits the world's gamemode.
Updates the gamemode on the client (sends the packet)