Fixed disabled classes still being validated.
This commit is contained in:
parent
88bb7f514c
commit
16280e0397
@ -610,16 +610,19 @@ ClassLoad()
|
|||||||
ClassData[ClassCount][Class_JumpHeight] = KvGetFloat(kvClassData, "jump_height", ZR_CLASS_DEFAULT_JUMP_HEIGHT);
|
ClassData[ClassCount][Class_JumpHeight] = KvGetFloat(kvClassData, "jump_height", ZR_CLASS_DEFAULT_JUMP_HEIGHT);
|
||||||
ClassData[ClassCount][Class_JumpDistance] = KvGetFloat(kvClassData, "jump_distance", ZR_CLASS_DEFAULT_JUMP_DISTANCE);
|
ClassData[ClassCount][Class_JumpDistance] = KvGetFloat(kvClassData, "jump_distance", ZR_CLASS_DEFAULT_JUMP_DISTANCE);
|
||||||
|
|
||||||
// Validate the class attributes.
|
// Validate class attributes if class is enabled.
|
||||||
ClassErrorFlags = ClassValidateAttributes(ClassCount, true);
|
if (ClassData[ClassCount][Class_Enabled])
|
||||||
if (ClassErrorFlags > 0)
|
|
||||||
{
|
{
|
||||||
// There's one or more invalid class attributes. Disable the class
|
ClassErrorFlags = ClassValidateAttributes(ClassCount, true);
|
||||||
// and log an error message.
|
if (ClassErrorFlags > 0)
|
||||||
ClassData[ClassCount][Class_Enabled] = false;
|
{
|
||||||
LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Playerclasses, "Config Validation", "Warning: Invalid class at index %d, disabled class. Class error flags: %d.", ClassCount, ClassErrorFlags);
|
// There's one or more invalid class attributes. Disable the class
|
||||||
|
// and log an error message.
|
||||||
|
ClassData[ClassCount][Class_Enabled] = false;
|
||||||
|
LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Playerclasses, "Config Validation", "Warning: Invalid class at index %d, disabled class. Class error flags: %d.", ClassCount, ClassErrorFlags);
|
||||||
|
|
||||||
failedcount++;
|
failedcount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the counter.
|
// Update the counter.
|
||||||
|
Loading…
Reference in New Issue
Block a user