[Fix] Fix NPC ghosting at safe coordinates (#2823)

* [Fix] Fix NPC ghosting at safe coordinates

* Tweak order

* Handle another case
This commit is contained in:
Chris Miles
2023-02-06 17:23:29 -06:00
committed by GitHub
parent b385a4385f
commit 0348cb6b8e
5 changed files with 36 additions and 1 deletions
+17
View File
@@ -778,6 +778,12 @@ void Client::CompleteConnect()
parse->EventPlayer(EVENT_ENTER_ZONE, this, "", 0);
// the way that the client deals with positions during the initial spawn struct
// is subtly different from how it deals with getting a position update
// if a mob is slightly in the wall or slightly clipping a floor they will be
// sent to a succor point
SendMobPositions();
SetLastPositionBeforeBulkUpdate(GetPosition());
/* This sub event is for if a player logs in for the first time since entering world. */
@@ -15730,3 +15736,14 @@ bool Client::CanTradeFVNoDropItem()
return false;
}
void Client::SendMobPositions()
{
auto p = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
auto *s = (PlayerPositionUpdateServer_Struct *) p->pBuffer;
for (auto &m: entity_list.GetMobList()) {
m.second->MakeSpawnUpdate(s);
QueuePacket(p, false);
}
safe_delete(p);
}