summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 a795bb9eb..83a553821 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -275,6 +275,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; }
@@ -283,6 +286,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);
@@ -376,8 +382,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
@@ -465,7 +471,7 @@ protected:
int m_FloaterID;
- cTeam* m_Team;
+ cTeam * m_Team;
@@ -488,6 +494,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