summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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)