Core/Vehicle: Add an extra check for required energy before setting power.

This commit is contained in:
Malcrom
2013-12-05 13:07:15 -03:30
parent 621ba87917
commit af5d3daeab

View File

@@ -102,7 +102,7 @@ void Vehicle::Install()
if (!spellInfo)
continue;
if (spellInfo->PowerType == POWER_ENERGY)
if (spellInfo->PowerType == POWER_ENERGY && spellInfo->CalcPowerCost(_me, spellInfo->GetSchoolMask()) > 0)
{
_me->setPowerType(POWER_ENERGY);
_me->SetMaxPower(POWER_ENERGY, 100);