[8586] Fixed crash when no event indexes loaded.

Minor coding style fixes.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-10-06 03:11:44 +02:00
parent b9168145b5
commit 9e669137a1

View file

@ -2133,12 +2133,18 @@ void BattleGroundMgr::LoadBattleEventIndexes()
"LEFT OUTER JOIN battleground_events AS description ON data.map = description.map " "LEFT OUTER JOIN battleground_events AS description ON data.map = description.map "
"AND data.ev1 = description.event1 AND data.ev2 = description.event2 " "AND data.ev1 = description.event1 AND data.ev2 = description.event2 "
"ORDER BY m, ev1, ev2" ); "ORDER BY m, ev1, ev2" );
if( !result ) if(!result)
{ {
barGoLink bar( 1 ); barGoLink bar(1);
bar.step(); bar.step();
sLog.outString();
sLog.outErrorDb(">> Loaded 0 battleground eventindexes.");
return;
} }
barGoLink bar( result->GetRowCount() );
barGoLink bar(result->GetRowCount());
do do
{ {
bar.step(); bar.step();
@ -2190,10 +2196,9 @@ void BattleGroundMgr::LoadBattleEventIndexes()
++count; ++count;
} while( result->NextRow() ); } while(result->NextRow());
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u battleground eventindexes", count); sLog.outString( ">> Loaded %u battleground eventindexes", count);
if (count == 0)
return;
delete result; delete result;
} }