fix(Core/Vehicles): Prevent accessory double-install and respawn orphans (#25499)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
parent
b53e1b8eac
commit
687ceeea70
5 changed files with 24 additions and 8 deletions
|
|
@ -346,8 +346,7 @@ bool Map::AddToMap(T* obj, bool checkTransport)
|
|||
//also, trigger needs to cast spell, if not update, cannot see visual
|
||||
obj->UpdateObjectVisibility(true);
|
||||
|
||||
// Xinef: little hack for vehicles, accessories have to be added after visibility update so they wont fall off the vehicle, moved from Creature::AIM_Initialize
|
||||
// Initialize vehicle, this is done only for summoned npcs, DB creatures are handled by grid loaders
|
||||
// Post-visibility so accessories seat after the vehicle's create packet reaches clients.
|
||||
if (obj->IsCreature())
|
||||
if (Vehicle* vehicle = obj->ToCreature()->GetVehicleKit())
|
||||
vehicle->Reset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue