Minior fixes in class system.
This commit is contained in:
		| @@ -238,7 +238,7 @@ CvarsCreate() | |||||||
|     g_hCvarsList[CVAR_CLASSES_DEFAULT_ADMIN]            =    CreateConVar("zr_classes_default_admin",           "random",       "Admin class assigned to admins on connect. [\"random\" = Random admin class | \"\" = Class config default]"); |     g_hCvarsList[CVAR_CLASSES_DEFAULT_ADMIN]            =    CreateConVar("zr_classes_default_admin",           "random",       "Admin class assigned to admins on connect. [\"random\" = Random admin class | \"\" = Class config default]"); | ||||||
|      |      | ||||||
|     // Menu |     // Menu | ||||||
|     g_hCvarsList[CVAR_CLASSES_MENU_AUTOCLOSE]           =    CreateConVar("zr_classes_menu_autoclose",      "0",            "Automatically close class selection menu."); |     g_hCvarsList[CVAR_CLASSES_MENU_AUTOCLOSE]           =    CreateConVar("zr_classes_menu_autoclose",      "0",            "Automatically close class selection menu after selecting a class."); | ||||||
|      |      | ||||||
|     // Overlays |     // Overlays | ||||||
|     g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLE]           =    CreateConVar("zr_classes_overlay_toggle",      "1",            "Allow players to toggle class overlay."); |     g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLE]           =    CreateConVar("zr_classes_overlay_toggle",      "1",            "Allow players to toggle class overlay."); | ||||||
|   | |||||||
| @@ -172,9 +172,9 @@ ClassOnClientInfected(client, bool:motherzombie = false) | |||||||
|     // Check if it's a mother zombie. |     // Check if it's a mother zombie. | ||||||
|     if (motherzombie) |     if (motherzombie) | ||||||
|     { |     { | ||||||
|         // Set negative admin flag if client is admin, so it's removed in |         // Set admin flag if client is admin, so it's removed in special class | ||||||
|         // special class flags. |         // flags. | ||||||
|         isadmin = ZRIsClientAdmin(client) ? -ZR_CLASS_FLAG_ADMIN_ONLY : 0; |         isadmin = ZRIsClientAdmin(client) ? ZR_CLASS_FLAG_ADMIN_ONLY : 0; | ||||||
|          |          | ||||||
|         // Get default mother zombie setting. |         // Get default mother zombie setting. | ||||||
|         GetConVarString(g_hCvarsList[CVAR_CLASSES_DEFAULT_M_ZOMB], motherzombiesetting, sizeof(motherzombiesetting)); |         GetConVarString(g_hCvarsList[CVAR_CLASSES_DEFAULT_M_ZOMB], motherzombiesetting, sizeof(motherzombiesetting)); | ||||||
| @@ -186,7 +186,7 @@ ClassOnClientInfected(client, bool:motherzombie = false) | |||||||
|         else if (StrEqual(motherzombiesetting, "random", false)) |         else if (StrEqual(motherzombiesetting, "random", false)) | ||||||
|         { |         { | ||||||
|             // Get random regular zombie class. Remove admin flag if admin. |             // Get random regular zombie class. Remove admin flag if admin. | ||||||
|             motherindex = ClassGetRandomClass(ZR_CLASS_TEAM_ZOMBIES, _, _, ZR_CLASS_SPECIALFLAGS + isadmin); |             motherindex = ClassGetRandomClass(ZR_CLASS_TEAM_ZOMBIES, _, _, ZR_CLASS_SPECIALFLAGS - isadmin); | ||||||
|         } |         } | ||||||
|         else if (StrEqual(motherzombiesetting, "motherzombies", false)) |         else if (StrEqual(motherzombiesetting, "motherzombies", false)) | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -909,7 +909,7 @@ stock ClassGetDefaultSpawnClass(teamid, cachetype = ZR_CLASS_CACHE_MODIFIED) | |||||||
|                 // The class index is invalid or the team IDs didn't match. |                 // The class index is invalid or the team IDs didn't match. | ||||||
|                 // Because it's user input, we'll fall back to the first class |                 // Because it's user input, we'll fall back to the first class | ||||||
|                 // in the specified team, and log a warning. |                 // in the specified team, and log a warning. | ||||||
|                 classindex = ClassGetFirstClass(teamid, _, _, cachetype); |                 classindex = ClassGetFirstClass(teamid, _, _, ZR_CLASS_SPECIALFLAGS, cachetype); | ||||||
|                  |                  | ||||||
|                 LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Playerclasses, "Default Spawn Class", "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); |                 LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Playerclasses, "Default Spawn Class", "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); | ||||||
|                  |                  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user