[9132] Fixed crash at loading from player_classlevelstats level 0 data.

Added check that prevent loading data for unexpected level 0.
This commit is contained in:
VladimirMangos 2010-01-09 21:11:25 +03:00
parent 51cb5b356a
commit 1da5166c3c
2 changed files with 7 additions and 2 deletions

View file

@ -2611,7 +2611,12 @@ void ObjectMgr::LoadPlayerInfo()
}
uint32 current_level = fields[1].GetUInt32();
if(current_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
if(current_level == 0)
{
sLog.outErrorDb("Wrong level %u in `player_classlevelstats` table, ignoring.",current_level);
continue;
}
else if(current_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
{
if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9131"
#define REVISION_NR "9132"
#endif // __REVISION_NR_H__