Core/GameObjects: Transport (type 11) improvements

* Fully synchronize serverside animation progress with client
* Implemented updating passenger positions on elevators
* Removed visibility hack for elevators that always forced CreateObject packet to be sent to client
This commit is contained in:
Shauren
2022-05-25 22:14:32 +02:00
parent 3031fbb63b
commit 630b60eb0d
33 changed files with 707 additions and 310 deletions

View File

@@ -1265,9 +1265,7 @@ void Map::GameObjectRelocation(GameObject* go, float x, float y, float z, float
else
{
go->Relocate(x, y, z, orientation);
go->UpdateModelPosition();
go->UpdatePositionData();
go->UpdateObjectVisibility(false);
go->AfterRelocation();
RemoveGameObjectFromMoveList(go);
}
@@ -1491,9 +1489,7 @@ void Map::MoveAllGameObjectsInMoveList()
{
// update pos
go->Relocate(go->_newPosition);
go->UpdateModelPosition();
go->UpdatePositionData();
go->UpdateObjectVisibility(false);
go->AfterRelocation();
}
else
{
@@ -3028,7 +3024,7 @@ void Map::SendInitSelf(Player* player)
UpdateData data(player->GetMapId());
// attach to player data current transport data
if (Transport* transport = player->GetTransport())
if (Transport* transport = dynamic_cast<Transport*>(player->GetTransport()))
{
transport->BuildCreateUpdateBlockForPlayer(&data, player);
player->m_visibleTransports.insert(transport->GetGUID());
@@ -3038,7 +3034,7 @@ void Map::SendInitSelf(Player* player)
player->BuildCreateUpdateBlockForPlayer(&data, player);
// build other passengers at transport also (they always visible and marked as visible and will not send at visibility update at add to map
if (Transport* transport = player->GetTransport())
if (Transport* transport = dynamic_cast<Transport*>(player->GetTransport()))
for (WorldObject* passenger : transport->GetPassengers())
if (player != passenger && player->HaveAtClient(passenger))
passenger->BuildCreateUpdateBlockForPlayer(&data, player);