Core/Misc: improve error log messages by adding more info. Specially for Aokromes.

This commit is contained in:
Azazel
2011-02-17 19:47:08 +06:00
parent aaa9b069d9
commit 4dc1eaa47c
12 changed files with 82 additions and 74 deletions
@@ -751,7 +751,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry);
if (!cinfo)
{
sLog->outErrorDb("Creature entry %u does not exist.", Entry);
sLog->outErrorDb("Creature::Create(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
return false;
}
@@ -759,7 +759,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
if (!IsPositionValid())
{
sLog->outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,Entry,x,y);
sLog->outError("Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
return false;
}
@@ -1254,7 +1254,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry);
if (!cinfo)
{
sLog->outErrorDb("Creature entry %u does not exist.", Entry);
sLog->outErrorDb("Creature::CreateFromProto(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
return false;
}
+17 -27
View File
@@ -1846,13 +1846,14 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{
if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation))
{
sLog->outError("TeleportTo: invalid map %d or absent instance template.", mapid);
sLog->outError("TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).",
mapid, x, y, z, orientation, GetGUIDLow(), GetName(), GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
return false;
}
if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr->IsDisabledFor(DISABLE_TYPE_MAP, mapid, this))
{
sLog->outError("Player %s tried to enter a forbidden map %u", GetName(), mapid);
sLog->outError("Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUIDLow(), GetName(), mapid);
SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED);
return false;
}
@@ -6619,39 +6620,27 @@ void Player::CheckAreaExploreAndOutdoor()
uint32 Player::TeamForRace(uint8 race)
{
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
if (!rEntry)
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))
{
sLog->outError("Race %u not found in DBC: wrong DBC files?",uint32(race));
return ALLIANCE;
switch (rEntry->TeamID)
{
case 1: return HORDE;
case 7: return ALLIANCE;
}
sLog->outError("Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
}
else
sLog->outError("Race (%u) not found in DBC: wrong DBC files?", uint32(race));
switch(rEntry->TeamID)
{
case 7: return ALLIANCE;
case 1: return HORDE;
}
sLog->outError("Race %u have wrong teamid %u in DBC: wrong DBC files?",uint32(race),rEntry->TeamID);
return ALLIANCE;
}
uint32 Player::getFactionForRace(uint8 race)
{
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
if (!rEntry)
{
sLog->outError("Race %u not found in DBC: wrong DBC files?",uint32(race));
return 0;
}
return rEntry->FactionID;
}
void Player::setFactionForRace(uint8 race)
{
m_team = TeamForRace(race);
setFaction(getFactionForRace(race));
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
setFaction(rEntry ? rEntry->FactionID : 0);
}
ReputationRank Player::GetReputationRank(uint32 faction) const
@@ -8056,7 +8045,8 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32
SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]);
if (!spellInfo)
{
sLog->outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
sLog->outError("Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...",
GetGUIDLow(), GetName(), pEnchant->ID, pEnchant->spellid[s]);
continue;
}
-1
View File
@@ -1927,7 +1927,6 @@ class Player : public Unit, public GridObject<Player>
static uint32 TeamForRace(uint8 race);
uint32 GetTeam() const { return m_team; }
TeamId GetTeamId() const { return m_team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; }
static uint32 getFactionForRace(uint8 race);
void setFactionForRace(uint8 race);
void InitDisplayIds();
+4 -3
View File
@@ -16565,9 +16565,10 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const
break;
}
if (GetVehicle())
if (!this->HasUnitMovementFlag(MOVEMENTFLAG_ROOT))
sLog->outError("Unit does not have MOVEMENTFLAG_ROOT but is in vehicle!");
if (Vehicle* pVehicle = GetVehicle())
if (!HasUnitMovementFlag(MOVEMENTFLAG_ROOT))
sLog->outError("Unit (GUID: " UI64FMTD ", entry: %u) does not have MOVEMENTFLAG_ROOT but is in vehicle (ID: %u)!",
GetGUID(), GetEntry(), pVehicle->GetVehicleInfo()->m_ID);
*data << uint32(GetUnitMovementFlags()); // movement flags
*data << uint16(m_movementInfo.flags2); // 2.3.0