Fixed error output at creature loading.

This commit is contained in:
tomrus88 2010-02-07 00:54:45 +03:00
parent 0ef8305ebb
commit c990e2aaef

View file

@ -228,14 +228,14 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
uint32 display_id = sObjectMgr.ChooseDisplayId(team, GetCreatureInfo(), data); uint32 display_id = sObjectMgr.ChooseDisplayId(team, GetCreatureInfo(), data);
if (!display_id) // Cancel load if no display id if (!display_id) // Cancel load if no display id
{ {
sLog.outErrorDb("Creature (Entry: %u) has model %u not found in table `creature_model_info`, can't load. ", Entry, display_id); sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load.", Entry);
return false; return false;
} }
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id); CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (!minfo) // Cancel load if no model defined if (!minfo) // Cancel load if no model defined
{ {
sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry); sLog.outErrorDb("Creature (Entry: %u) has no model info defined in table `creature_model_info`, can't load.", Entry);
return false; return false;
} }
@ -774,7 +774,8 @@ void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, Monst
Player *Creature::GetLootRecipient() const Player *Creature::GetLootRecipient() const
{ {
if (!m_lootRecipient) return NULL; if (!m_lootRecipient)
return NULL;
else return ObjectAccessor::FindPlayer(m_lootRecipient); else return ObjectAccessor::FindPlayer(m_lootRecipient);
} }
@ -1371,7 +1372,7 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
} }
bool bcontinue = true; bool bcontinue = true;
for(uint32 j=0;j<3;j++) for(uint32 j = 0; j < 3; ++j)
{ {
if( (spellInfo->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE ) || if( (spellInfo->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE ) ||
(spellInfo->Effect[j] == SPELL_EFFECT_INSTAKILL) || (spellInfo->Effect[j] == SPELL_EFFECT_INSTAKILL) ||
@ -1423,7 +1424,7 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
} }
bool bcontinue = true; bool bcontinue = true;
for(uint32 j=0;j<3;j++) for(uint32 j = 0; j < 3; ++j)
{ {
if( (spellInfo->Effect[j] == SPELL_EFFECT_HEAL ) ) if( (spellInfo->Effect[j] == SPELL_EFFECT_HEAL ) )
{ {
@ -1431,7 +1432,8 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
break; break;
} }
} }
if(bcontinue) continue; if(bcontinue)
continue;
if(spellInfo->manaCost > GetPower(POWER_MANA)) if(spellInfo->manaCost > GetPower(POWER_MANA))
continue; continue;
@ -1726,7 +1728,7 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
uint32 enemy_team = attacker->GetTeam(); uint32 enemy_team = attacker->GetTeam();
WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4); WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4);
data << (uint32)GetZoneId(); data << uint32(GetZoneId());
sWorld.SendGlobalMessage(&data, NULL, (enemy_team == ALLIANCE ? HORDE : ALLIANCE)); sWorld.SendGlobalMessage(&data, NULL, (enemy_team == ALLIANCE ? HORDE : ALLIANCE));
} }
@ -1824,7 +1826,7 @@ bool Creature::HasSpell(uint32 spellID) const
for(i = 0; i < CREATURE_MAX_SPELLS; ++i) for(i = 0; i < CREATURE_MAX_SPELLS; ++i)
if(spellID == m_spells[i]) if(spellID == m_spells[i])
break; break;
return i < CREATURE_MAX_SPELLS; //broke before end of iteration of known spells return i < CREATURE_MAX_SPELLS; // break before end of iteration of known spells
} }
time_t Creature::GetRespawnTimeEx() const time_t Creature::GetRespawnTimeEx() const