Core/Misc: improve error log messages by adding more info. Specially for Aokromes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user