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:
blinkysc 2026-04-19 10:09:51 -05:00 committed by GitHub
parent b53e1b8eac
commit 687ceeea70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 8 deletions

View file

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