* Add NULL-pointer check to CharmInfo destructor. Closes issue #3287.

* Remove references to AuctionHouseBot files from win project.

--HG--
branch : trunk
This commit is contained in:
azazel
2010-08-06 15:50:12 +06:00
parent 4fb3098d18
commit eb5fb3664b

View File

@@ -61,7 +61,6 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI
default:
break;
}
ASSERT(!m_Seats.empty());
}
Vehicle::~Vehicle()
@@ -72,39 +71,39 @@ Vehicle::~Vehicle()
void Vehicle::Install()
{
if (Creature *cre = dynamic_cast<Creature*>(me))
if (Creature *pCreature = me->ToCreature())
{
if (m_vehicleInfo->m_powerType == POWER_STEAM)
switch (m_vehicleInfo->m_powerType)
{
me->setPowerType(POWER_ENERGY);
me->SetMaxPower(POWER_ENERGY, 100);
}
else if (m_vehicleInfo->m_powerType == POWER_PYRITE)
{
me->setPowerType(POWER_ENERGY);
me->SetMaxPower(POWER_ENERGY, 50);
}
else
{
for (uint32 i = 0; i < MAX_SPELL_VEHICLE; ++i)
{
if (!cre->m_spells[i])
continue;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(cre->m_spells[i]);
if (!spellInfo)
continue;
if (spellInfo->powerType == POWER_MANA)
break;
if (spellInfo->powerType == POWER_ENERGY)
case POWER_STEAM:
me->setPowerType(POWER_ENERGY);
me->SetMaxPower(POWER_ENERGY, 100);
break;
case POWER_PYRITE:
me->setPowerType(POWER_ENERGY);
me->SetMaxPower(POWER_ENERGY, 50);
break;
default:
for (uint32 i = 0; i < MAX_SPELL_VEHICLE; ++i)
{
me->setPowerType(POWER_ENERGY);
me->SetMaxPower(POWER_ENERGY, 100);
break;
if (!pCreature->m_spells[i])
continue;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(pCreature->m_spells[i]);
if (!spellInfo)
continue;
if (spellInfo->powerType == POWER_MANA)
break;
if (spellInfo->powerType == POWER_ENERGY)
{
me->setPowerType(POWER_ENERGY);
me->SetMaxPower(POWER_ENERGY, 100);
break;
}
}
}
break;
}
}