summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-03-16 21:47:34 +0100
committerMattes D <github@xoft.cz>2014-03-16 21:47:34 +0100
commit4ec402e6f9431db61cffe8f9f5c964bbbd14929d (patch)
tree13a884198c3a9bffb34634aff2d91042655413d9 /src/Entities/Player.h
parentMerge pull request #809 from Howaner/BlockEntitys (diff)
parentFixed VERIFY (diff)
downloadcuberite-4ec402e6f9431db61cffe8f9f5c964bbbd14929d.tar
cuberite-4ec402e6f9431db61cffe8f9f5c964bbbd14929d.tar.gz
cuberite-4ec402e6f9431db61cffe8f9f5c964bbbd14929d.tar.bz2
cuberite-4ec402e6f9431db61cffe8f9f5c964bbbd14929d.tar.lz
cuberite-4ec402e6f9431db61cffe8f9f5c964bbbd14929d.tar.xz
cuberite-4ec402e6f9431db61cffe8f9f5c964bbbd14929d.tar.zst
cuberite-4ec402e6f9431db61cffe8f9f5c964bbbd14929d.zip
Diffstat (limited to 'src/Entities/Player.h')
-rw-r--r--src/Entities/Player.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index f9404dfaf..c25053c21 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -270,6 +270,9 @@ public:
/// Returns true if the player is currently flying.
bool IsFlying(void) const { return m_IsFlying; }
+ /** Returns if a player is sleeping in a bed */
+ bool IsInBed(void) const { return m_bIsInBed; }
+
/// returns true if the player has thrown out a floater.
bool IsFishing(void) const { return m_IsFishing; }
@@ -278,6 +281,9 @@ public:
int GetFloaterID(void) const { return m_FloaterID; }
// tolua_end
+
+ /** Sets a player's in-bed state; we can't be sure plugins will keep this value updated, so no exporting */
+ void SetIsInBed(bool a_Flag) { m_bIsInBed = a_Flag; }
/// Starts eating the currently equipped item. Resets the eating timer and sends the proper animation packet
void StartEating(void);
@@ -371,8 +377,8 @@ protected:
GroupList m_ResolvedGroups;
GroupList m_Groups;
- std::string m_PlayerName;
- std::string m_LoadedWorldName;
+ AString m_PlayerName;
+ AString m_LoadedWorldName;
/// Xp Level stuff
enum
@@ -456,7 +462,7 @@ protected:
int m_FloaterID;
- cTeam* m_Team;
+ cTeam * m_Team;
@@ -479,6 +485,11 @@ protected:
/// Adds food exhaustion based on the difference between Pos and LastPos, sprinting status and swimming (in water block)
void ApplyFoodExhaustionFromMovement();
+
+ /** Flag representing whether the player is currently in a bed
+ Set by a right click on unoccupied bed, unset by a time fast forward or teleport */
+ bool m_bIsInBed;
+
} ; // tolua_export