[7716] Fixed some typos and possible crashes.

This commit is contained in:
AlexDereka 2009-04-26 18:49:00 +04:00
parent c2e6dd20dd
commit c9d51a6dc7
25 changed files with 281 additions and 263 deletions

View file

@ -600,12 +600,12 @@ void ObjectMgr::LoadCreatureTemplates()
sLog.outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u)", cInfo->Entry, cInfo->PetSpellDataId);
}
for(int i = 0; i < CREATURE_MAX_SPELLS; ++i)
for(int j = 0; j < CREATURE_MAX_SPELLS; ++j)
{
if(cInfo->spells[i] && !sSpellStore.LookupEntry(cInfo->spells[i]))
if(cInfo->spells[j] && !sSpellStore.LookupEntry(cInfo->spells[j]))
{
sLog.outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0", cInfo->Entry, i+1,cInfo->spells[i]);
const_cast<CreatureInfo*>(cInfo)->spells[i] = 0;
sLog.outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0", cInfo->Entry, j+1,cInfo->spells[j]);
const_cast<CreatureInfo*>(cInfo)->spells[j] = 0;
}
}
@ -2694,15 +2694,15 @@ void ObjectMgr::LoadGroups()
result = CharacterDatabase.Query("SELECT memberGuid, assistant, subgroup, leaderGuid FROM group_member ORDER BY leaderGuid");
if(!result)
{
barGoLink bar( 1 );
bar.step();
barGoLink bar2( 1 );
bar2.step();
}
else
{
barGoLink bar( result->GetRowCount() );
barGoLink bar2( result->GetRowCount() );
do
{
bar.step();
bar2.step();
Field *fields = result->Fetch();
count++;
leaderGuid = MAKE_NEW_GUID(fields[3].GetUInt32(), 0, HIGHGUID_PLAYER);
@ -2754,15 +2754,15 @@ void ObjectMgr::LoadGroups()
if(!result)
{
barGoLink bar( 1 );
bar.step();
barGoLink bar2( 1 );
bar2.step();
}
else
{
barGoLink bar( result->GetRowCount() );
barGoLink bar2( result->GetRowCount() );
do
{
bar.step();
bar2.step();
Field *fields = result->Fetch();
count++;
leaderGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
@ -3149,7 +3149,7 @@ void ObjectMgr::LoadQuests()
{
sLog.outErrorDb("Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.",
qinfo->GetQuestId(),j+1,id,id);
// no changes, quest can't be done for this requirement
continue;
}
if(!qinfo->ReqCreatureOrGOId[j])