summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/BedEntity.cpp
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2017-09-25 18:17:45 +0200
committerMattes D <github@xoft.cz>2017-09-25 18:17:45 +0200
commit10c5c1227e5a663b3a53c336cfa6a0a98f874265 (patch)
treeb45f06fd4d7ceaca6807113d58d4aba7166d9aa5 /src/BlockEntities/BedEntity.cpp
parentcBlockArea: Fix performance regression (#4045) (diff)
downloadcuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.gz
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.bz2
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.lz
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.xz
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.zst
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.zip
Diffstat (limited to '')
-rw-r--r--src/BlockEntities/BedEntity.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/BlockEntities/BedEntity.cpp b/src/BlockEntities/BedEntity.cpp
index b8f61c049..c74448661 100644
--- a/src/BlockEntities/BedEntity.cpp
+++ b/src/BlockEntities/BedEntity.cpp
@@ -43,14 +43,12 @@ void cBedEntity::SendTo(cClientHandle & a_Client)
void cBedEntity::SetColor(short a_Color)
{
m_Color = a_Color;
- int posX = m_PosX;
- int posY = m_PosY;
- int posZ = m_PosZ;
+ auto Pos = GetPos();
// If the bed entity is send immediately, the client (maybe) still has not the bed.
// Fix that by delaying the broadcast of the bed entity by a tick:
- m_World->ScheduleTask(1, [posX, posY, posZ](cWorld & a_World)
+ m_World->ScheduleTask(1, [Pos](cWorld & a_World)
{
- a_World.BroadcastBlockEntity(posX, posY, posZ);
+ a_World.BroadcastBlockEntity(Pos);
});
}