[11963] Add additional check for game_events, invalid occurence

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2012-04-15 11:55:21 +02:00
parent 110c16de13
commit f3b5e1e4bc
2 changed files with 12 additions and 6 deletions

View file

@ -152,6 +152,12 @@ void GameEventMgr::LoadFromDB()
continue; continue;
} }
if (pGameEvent.occurence < pGameEvent.length) // occurence < length is useless. This also asserts that occurence > 0!
{
sLog.outErrorDb("`game_event` game event id (%i) has occurence %u < length %u and can't be used.", event_id, pGameEvent.occurence, pGameEvent.length);
continue;
}
if (pGameEvent.holiday_id != HOLIDAY_NONE) if (pGameEvent.holiday_id != HOLIDAY_NONE)
{ {
if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id)) if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id))

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11962" #define REVISION_NR "11963"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__