From ddf8be76f9af63dc12796212bce26bc9b517f3d0 Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Sun, 10 Jul 2011 13:37:00 +0200 Subject: [PATCH] Fixed index out of bounds error when class limit is reached. Bumped class limit to 64 classes. --- src/zr/playerclasses/playerclasses.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/zr/playerclasses/playerclasses.inc b/src/zr/playerclasses/playerclasses.inc index f80ef9c..bcbe489 100644 --- a/src/zr/playerclasses/playerclasses.inc +++ b/src/zr/playerclasses/playerclasses.inc @@ -42,10 +42,9 @@ */ /** - * Total number of classes that can be stored in each cache. A total of 32 - * classes should be enough. Too many classes will confuse players. + * Total number of classes that can be stored in each cache. */ -#define ZR_CLASS_MAX 48 +#define ZR_CLASS_MAX 64 /** * @section Class cache types. Specifies what data array to use. @@ -549,7 +548,7 @@ ClassLoad() // Loop through all classes and store attributes in the ClassData array. do { - if (ClassCount > ZR_CLASS_MAX) + if (ClassCount >= ZR_CLASS_MAX) { // Maximum classes reached. Write a warning and exit the loop. LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Playerclasses, "Config Validation", "Warning: Maximum classes reached (%d). Skipping other classes.", ZR_CLASS_MAX + 1);