*Some clean up and add debug info to find the reason of crash.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-26 19:28:21 -05:00
parent 390257b2f6
commit 21af4cf832
11 changed files with 88 additions and 58 deletions

View File

@@ -44,6 +44,8 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI
Vehicle::~Vehicle()
{
for(SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
assert(!itr->second.passenger);
}
void Vehicle::Install()
@@ -198,7 +200,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId)
passenger->ExitVehicle(); // this should not happen
}
Creature *accessory = me->SummonCreature(entry, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, 0);
Creature *accessory = me->SummonCreature(entry, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
if(!accessory)
return;
accessory->AddUnitTypeMask(UNIT_MASK_ACCESSORY);