fix(Core/Vehicles): defer accessory init to avoid double install (#25486)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andrew
2026-04-16 17:15:30 -03:00
committed by GitHub
parent a0e831c954
commit fc74e0e1fb
3 changed files with 14 additions and 8 deletions

View File

@@ -346,11 +346,6 @@ 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
if (obj->IsCreature())
if (Vehicle* vehicle = obj->ToCreature()->GetVehicleKit())
vehicle->Reset();
return true;
}