From da1405d365d86a89f1828dc485a6e76acb8b306d Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 18 Feb 2022 13:40:02 -0500 Subject: [PATCH] Core/Vehicles: update the power display of vehicles before being added to world to avoid building unnecessary update_object packets right after spawning them Port From (https://github.com/TrinityCore/TrinityCore/commit/f4f56c105fabf33398d332c09c8e331bc4025192) --- Source/Game/Entities/Creature/Creature.cs | 3 ++- Source/Game/Entities/Vehicle.cs | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index fb3f627a5..83fd18c3e 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -1532,7 +1532,8 @@ namespace Game.Entities } if (vehId != 0) - CreateVehicleKit(vehId, entry, true); + if (CreateVehicleKit(vehId, entry, true)) + UpdateDisplayPower(); return true; } diff --git a/Source/Game/Entities/Vehicle.cs b/Source/Game/Entities/Vehicle.cs index b02e009c6..6dda92c1a 100644 --- a/Source/Game/Entities/Vehicle.cs +++ b/Source/Game/Entities/Vehicle.cs @@ -72,8 +72,6 @@ namespace Game.Entities public void Install() { - _me.UpdateDisplayPower(); - _status = Status.Installed; if (GetBase().IsTypeId(TypeId.Unit)) Global.ScriptMgr.OnInstall(this);