summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-02-08 22:21:48 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-02-08 22:21:48 +0100
commit3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0 (patch)
tree263dd59173d388fa8e7c83d51c928004a230737a /src/Entities/Player.h
parentProtocol 1.7: Fixed Coverity issues. (diff)
downloadcuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.gz
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.bz2
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.lz
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.xz
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.zst
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index 7abb1b98a..10cf6f7e8 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -314,8 +314,18 @@ public:
// 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; }
+ /** Sets a player's in-bed state
+ We can't be sure plugins will keep this value updated, so no exporting
+ If value is false (not in bed), will update players of the fact that they have been ejected from the bed
+ */
+ void SetIsInBed(bool a_Flag)
+ {
+ m_bIsInBed = a_Flag;
+ if (!a_Flag)
+ {
+ GetWorld()->BroadcastEntityAnimation(*this, 2);
+ }
+ }
/** Starts eating the currently equipped item. Resets the eating timer and sends the proper animation packet */
void StartEating(void);