fix(Core/Vehicles): Salvaged Demolishers should spawn with full pyrite (#27399)

This commit is contained in:
Andrew
2026-08-31 04:49:40 -03:00
committed by GitHub
parent 7e18ca5b8d
commit 54783860e4
@@ -28,6 +28,11 @@
#include "Util.h"
#include <algorithm>
enum PowerDisplayIds
{
POWER_DISPLAY_PYRITE = 41
};
Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
_me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry), _status(STATUS_NONE),
_accessoriesInstalled(false)
@@ -76,7 +81,14 @@ void Vehicle::Install()
if (_me->IsCreature())
{
if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(_vehicleInfo->m_powerDisplayId))
{
_me->setPowerType(Powers(powerDisplay->PowerType));
// Pyrite does not regenerate and is only refilled by scripted energizes,
// so the Salvaged Demolisher and its Mechanic Seat spawn with a full bar
if (_vehicleInfo->m_powerDisplayId == POWER_DISPLAY_PYRITE)
_me->SetPower(_me->getPowerType(), _me->GetMaxPower(_me->getPowerType()));
}
else if (_me->IsClass(CLASS_ROGUE, CLASS_CONTEXT_ABILITY))
_me->setPowerType(POWER_ENERGY);
}