mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 07:21:48 +00:00
[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:
parent
b385a4385f
commit
0348cb6b8e
@ -2083,6 +2083,7 @@ private:
|
||||
bool m_bot_precombat;
|
||||
|
||||
bool CanTradeFVNoDropItem();
|
||||
void SendMobPositions();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -718,6 +718,8 @@ void EntityList::AddNPC(NPC *npc, bool send_spawn_packet, bool dont_queue)
|
||||
}
|
||||
}
|
||||
|
||||
npc->SendPositionToClients();
|
||||
|
||||
entity_list.ScanCloseMobs(npc->close_mobs, npc, true);
|
||||
|
||||
npc->DispatchZoneControllerEvent(EVENT_SPAWN_ZONE, npc, "", 0, nullptr);
|
||||
@ -844,8 +846,10 @@ void EntityList::CheckSpawnQueue()
|
||||
NPC *pnpc = it->second;
|
||||
pnpc->SendArmorAppearance();
|
||||
pnpc->SetAppearance(pnpc->GetGuardPointAnim(), false);
|
||||
if (!pnpc->IsTargetable())
|
||||
if (!pnpc->IsTargetable()) {
|
||||
pnpc->SendTargetable(false);
|
||||
}
|
||||
pnpc->SendPositionToClients();
|
||||
}
|
||||
safe_delete(outapp);
|
||||
iterator.RemoveCurrent();
|
||||
|
||||
11
zone/npc.cpp
11
zone/npc.cpp
@ -3783,3 +3783,14 @@ int NPC::GetRolledItemCount(uint32 item_id)
|
||||
|
||||
return rolled_count;
|
||||
}
|
||||
|
||||
void NPC::SendPositionToClients()
|
||||
{
|
||||
auto p = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||
auto *s = (PlayerPositionUpdateServer_Struct *) p->pBuffer;
|
||||
for (auto &c: entity_list.GetClientList()) {
|
||||
MakeSpawnUpdate(s);
|
||||
c.second->QueuePacket(p, false);
|
||||
}
|
||||
safe_delete(p);
|
||||
}
|
||||
|
||||
@ -536,6 +536,8 @@ public:
|
||||
void RecalculateSkills();
|
||||
void ReloadSpells();
|
||||
|
||||
void SendPositionToClients();
|
||||
|
||||
static LootDropEntries_Struct NewLootDropEntry();
|
||||
|
||||
protected:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user