aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorazazel <none@none>2010-08-06 15:50:12 +0600
committerazazel <none@none>2010-08-06 15:50:12 +0600
commiteb5fb3664b8dee86b9cccb1d50404c3dae6212f0 (patch)
treebd22168912046033a536d0e9b495129f5d55039e /src
parent4fb3098d189ba62290fcc0ed33f527a3743f05d9 (diff)
* Add NULL-pointer check to CharmInfo destructor. Closes issue #3287.
* Remove references to AuctionHouseBot files from win project. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Vehicle/Vehicle.cpp59
1 files changed, 29 insertions, 30 deletions
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index 67d8b4ce92c..818cbd67904 100644
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -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;
}
}