chore(Core/Misc): add LOG_ERROR where there was commented ASSERT (#6761)

This commit is contained in:
Kitzunu
2021-07-07 17:56:17 +02:00
committed by GitHub
parent b66314b67d
commit 66da9f1354
7 changed files with 30 additions and 10 deletions

View File

@@ -17761,12 +17761,17 @@ void Player::_LoadArenaTeamInfo()
if (uint32 arenaTeamId = Player::GetArenaTeamIdFromStorage(GetGUID().GetCounter(), itr.second))
{
ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(arenaTeamId);
if (!arenaTeam) // some shit, should be assert, but just ignore
if (!arenaTeam)
{
LOG_ERROR("bg.arena", "Player::_LoadArenaTeamInfo: No arena team was found.");
continue;
}
ArenaTeamMember const* member = arenaTeam->GetMember(GetGUID());
if (!member) // some shit, should be assert, but just ignore
if (!member)
{
LOG_ERROR("bg.arena", "Player::_LoadArenaTeamInfo: No members in the arena team (%u) was found.", arenaTeamId);
continue;
}
uint8 slot = itr.second;
SetArenaTeamInfoField(slot, ARENA_TEAM_ID, arenaTeamId);

View File

@@ -731,7 +731,17 @@ bool StaticTransport::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* m
SetGoAnimProgress(animprogress);
m_goValue.Transport.AnimationInfo = sTransportMgr->GetTransportAnimInfo(goinfo->entry);
//ASSERT(m_goValue.Transport.AnimationInfo);
if (!m_goValue.Transport.AnimationInfo)
{
LOG_ERROR("vehicle", "StaticTransport::Create: No AnimationInfo was found for GameObject entry (%u)", goinfo->entry);
return false;
}
//ASSERT(m_goValue.Transport.AnimationInfo->TotalTime > 0);
if (!m_goValue.Transport.AnimationInfo->TotalTime)
{
LOG_ERROR("vehicle", "StaticTransport::Create: AnimationInfo->TotalTime is 0 for GameObject entry (%u)", goinfo->entry);
return false;
}
SetPauseTime(goinfo->transport.pauseAtTime);
if (goinfo->transport.startOpen && goinfo->transport.pauseAtTime)
{

View File

@@ -441,7 +441,11 @@ void Vehicle::RemovePassenger(Unit* unit)
// but the unit is not on the vehicles seat yet, thus crashing at ASSERT(seat != Seats.end());
// ASSERT(seat != Seats.end());
if (seat == Seats.end())
{
LOG_ERROR("vehicles", "Vehicle::RemovePassenger: Vehicle entry (%u) id (%u) is dissmised and removed all existing passangers, but the unit (%s) was not on the vehicle!",
_me->GetEntry(), _vehicleInfo->m_ID, unit->GetName().c_str());
return;
}
LOG_DEBUG("vehicles", "Unit %s exit vehicle entry %u id %u (%s) seat %d",
unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().ToString().c_str(), (int32)seat->first);

View File

@@ -60,9 +60,9 @@ inline void Cell::Visit(CellCoord const& standing_cell, TypeContainerVisitor<T,
if (!standing_cell.IsCoordValid())
return;
//no jokes here... Actually placing ASSERT() here was good idea, but
//we had some problems with DynamicObjects, which pass radius = 0.0f (DB issue?)
//maybe it is better to just return when radius <= 0.0f?
// no jokes here... Actually placing ASSERT() here was good idea, but
// we had some problems with DynamicObjects, which pass radius = 0.0f (DB issue?)
// maybe it is better to just return when radius <= 0.0f?
if (radius <= 0.0f)
{
map.Visit(*this, visitor);

View File

@@ -53,6 +53,7 @@ Map::~Map()
{
WorldObject* obj = *i_worldObjects.begin();
ASSERT(obj->IsWorldObject());
LOG_ERROR("maps", "Map::~Map: WorldObject TypeId is not a corpse! (%u)", static_cast<uint8>(obj->GetTypeId()));
//ASSERT(obj->GetTypeId() == TYPEID_CORPSE);
obj->RemoveFromWorld();
obj->ResetMap();
@@ -540,7 +541,7 @@ bool Map::AddToMap(T* obj, bool checkTransport)
ASSERT(cellCoord.IsCoordValid());
if (!cellCoord.IsCoordValid())
{
LOG_ERROR("maps", "Map::Add: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]",
LOG_ERROR("maps", "Map::AddToMap: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]",
obj->GetGUID().ToString().c_str(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
return false; //Should delete object
}

View File

@@ -1103,8 +1103,8 @@ void Aura::UnregisterSingleTarget()
Unit* caster = GetCaster();
if (!caster)
{
LOG_INFO("misc", "Aura::UnregisterSingleTarget (A1) - %u, %u, %u, %s", GetId(), GetOwner()->GetTypeId(), GetOwner()->GetEntry(), GetOwner()->GetName().c_str());
//ASSERT(caster);
LOG_INFO("spells", "Aura::UnregisterSingleTarget: (A1) - %u, %u, %u, %s", GetId(), GetOwner()->GetTypeId(), GetOwner()->GetEntry(), GetOwner()->GetName().c_str());
LOG_ERROR("spells", "Aura::UnregisterSingleTarget: No caster was found."); //ASSERT(caster);
}
else
caster->GetSingleCastAuras().remove(this);

View File

@@ -675,7 +675,7 @@ Spell::~Spell()
{
// Clean the reference to avoid later crash.
// If this error is repeating, we may have to add an ASSERT to better track down how we get into this case.
LOG_ERROR("spells", "SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
LOG_ERROR("spells", "Spell::~Spell: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
*m_selfContainer = nullptr;
}