*Fix or add debug message for crash caused by controlled creatures

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-19 11:19:23 -05:00
parent b86ef4c3a8
commit 15a753351c
5 changed files with 20 additions and 9 deletions
+4
View File
@@ -1835,6 +1835,7 @@ void Player::RemoveFromWorld()
///- Release charmed creatures, unsummon totems and remove pets/guardians
StopCastingCharm();
StopCastingBindSight();
UnsummonPetTemporaryIfAny();
sOutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
}
@@ -16695,6 +16696,9 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
if(pet)
sLog.outDebug("RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent);
if(pet->m_removed)
return;
if(returnreagent && (pet || m_temporaryUnsummonedPetNumber))
{
//returning of reagents only for players, so best done here
+3 -3
View File
@@ -63,11 +63,11 @@ template<class T>
inline uint32 Traveller<T>::GetTotalTrevelTimeTo(float x, float y, float z)
{
float dist = GetMoveDestinationTo(x,y,z);
float speed = 0.001f;
if (Speed() <= 0.0f)
float speed = Speed();;
if (speed <= 0.0f)
return 0xfffffffe; // almost infinity-unit should stop
else
speed *= Speed(); // speed is in seconds so convert from second to millisecond
speed *= 0.001f; // speed is in seconds so convert from second to millisecond
return static_cast<uint32>(dist/speed);
}
+7 -4
View File
@@ -8935,8 +8935,10 @@ void Unit::RemoveAllControlled()
sLog.outError("Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
}
}
if(GetPetGUID() != GetMinionGUID())
sLog.outCrash("Unit %u is not able to release its summon " I64FMT, GetEntry(), GetMinionGUID());
if(GetPetGUID())
sLog.outCrash("Unit %u is not able to release its pet " I64FMT, GetEntry(), GetPetGUID());
if(GetMinionGUID())
sLog.outCrash("Unit %u is not able to release its minion " I64FMT, GetEntry(), GetMinionGUID());
if(GetCharmGUID())
sLog.outCrash("Unit %u is not able to release its charm " I64FMT, GetEntry(), GetCharmGUID());
}
@@ -12054,12 +12056,13 @@ void Unit::RemoveFromWorld()
if(IsInWorld())
{
UnsummonAllTotems();
RemoveAllControlled();
RemoveCharmAuras();
RemoveBindSightAuras();
RemoveNotOwnSingleTargetAuras();
ExitVehicle();
UnsummonAllTotems();
RemoveAllControlled();
if(m_NotifyListPos >= 0)
{
+4
View File
@@ -161,8 +161,12 @@ void Vehicle::RemoveAllPassengers()
if(passenger->GetTypeId() == TYPEID_UNIT && ((Creature*)passenger)->isVehicle())
((Vehicle*)passenger)->RemoveAllPassengers();
passenger->ExitVehicle();
if(itr->second.passenger)
{
sLog.outCrash("Vehicle %u cannot remove passenger %u.", GetEntry(), itr->second.passenger->GetEntry());
assert(!itr->second.passenger);
}
}
}
void Vehicle::SetVehicleId(uint32 id)
+1 -1
View File
@@ -202,7 +202,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
MovementInform(unit);
unit.UpdateWaypointID(i_currentNode);
unit.clearUnitState(UNIT_STAT_MOVING);
unit.clearUnitState(UNIT_STAT_ROAMING);
unit.Relocate(node->x, node->y, node->z);
}
}