Added support for post map configs (with workaround for SourceMod bug 3803). Log cleanup. Minior fixes.
Removed log check in fatal errors. Those must always log. Stored LogCheckFlag result in a boolean where log is executed more than once. Fixed invalid translation string used in menu title. Fixed index out of bounds in zspawn when a client disconnects.
This commit is contained in:
@ -660,6 +660,9 @@ ClassGetDefaultSpawnClass(teamid, cachetype = ZR_CLASS_CACHE_MODIFIED)
|
||||
decl String:classname[64];
|
||||
new classindex;
|
||||
|
||||
// Initialize log boolean.
|
||||
new bool:enablelog = LogCheckFlag(LOG_CORE_EVENTS, LOG_MODULE_CLASSES);
|
||||
|
||||
// Get the default class name from the correct CVAR depending on teamid.
|
||||
switch (teamid)
|
||||
{
|
||||
@ -723,7 +726,7 @@ ClassGetDefaultSpawnClass(teamid, cachetype = ZR_CLASS_CACHE_MODIFIED)
|
||||
// in the specified team, and log a warning.
|
||||
classindex = ClassGetFirstClass(teamid, _, cachetype);
|
||||
|
||||
if (LogCheckFlag(LOG_CORE_EVENTS, LOG_MODULE_CLASSES))
|
||||
if (enablelog)
|
||||
{
|
||||
LogMessageFormatted(-1, "Classes", "DefaultSpawnClass", "Warning: Failed to set \"%s\" as default spawn class for team %d. The class doesn't exist or the team IDs doesn't match. Falling back to the first class in the team.", _, classname, teamid);
|
||||
}
|
||||
@ -732,7 +735,7 @@ ClassGetDefaultSpawnClass(teamid, cachetype = ZR_CLASS_CACHE_MODIFIED)
|
||||
if (ClassValidateIndex(classindex))
|
||||
{
|
||||
// Log a warning.
|
||||
if (LogCheckFlag(LOG_CORE_EVENTS, LOG_MODULE_CLASSES))
|
||||
if (enablelog)
|
||||
{
|
||||
LogMessageFormatted(-1, "Classes", "DefaultSpawnClass", "Warning: The default class name \"%s\" does not exist or matches the team ID.", _, classname);
|
||||
}
|
||||
|
Reference in New Issue
Block a user