summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 01:17:23 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-09 16:32:34 +0100
commitb64e9fb7f52e4a2b75b49413fdc2194132885370 (patch)
treea967875d53f6530d88065460c3e853c955ea10f5 /src/Entities/Player.h
parentMerge pull request #777 from jfhumann/issue317 (diff)
downloadcuberite-b64e9fb7f52e4a2b75b49413fdc2194132885370.tar
cuberite-b64e9fb7f52e4a2b75b49413fdc2194132885370.tar.gz
cuberite-b64e9fb7f52e4a2b75b49413fdc2194132885370.tar.bz2
cuberite-b64e9fb7f52e4a2b75b49413fdc2194132885370.tar.lz
cuberite-b64e9fb7f52e4a2b75b49413fdc2194132885370.tar.xz
cuberite-b64e9fb7f52e4a2b75b49413fdc2194132885370.tar.zst
cuberite-b64e9fb7f52e4a2b75b49413fdc2194132885370.zip
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