From 7dc96f04415e4c3a9f59fd6c9c0a20a89023589a Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 2 Nov 2013 17:44:55 +0100 Subject: Added cPlayer::GetEffectiveGameMode(). --- source/Entities/Player.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/Entities/Player.h') 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) -- cgit v1.2.3