1
0

BroadcastBlockBreakAnimation and BroadcastBlockEntity use vectors (#4038)

This commit is contained in:
Bond-009
2017-09-25 18:17:45 +02:00
committed by Mattes D
parent 463fa48aec
commit 10c5c1227e
13 changed files with 62 additions and 67 deletions

View File

@@ -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);
});
}