From f8f84dd0918609451da71290993c8f19aff8aeee Mon Sep 17 00:00:00 2001 From: BotoX Date: Mon, 18 Nov 2019 22:38:00 +0100 Subject: [PATCH] zclass fix remaining bugs --- src/zr/playerclasses/classmenus.inc | 4 ++-- src/zr/playerclasses/playerclasses.inc | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/zr/playerclasses/classmenus.inc b/src/zr/playerclasses/classmenus.inc index fe9e8c9..1b9b63d 100644 --- a/src/zr/playerclasses/classmenus.inc +++ b/src/zr/playerclasses/classmenus.inc @@ -325,7 +325,7 @@ ClassMenuSelect(client, teamid) ClassGetDescription(classindex, description, sizeof(description), ZR_CLASS_CACHE_MODIFIED); // Add menu item. Using extra spaces for indention on the second line. - Format(menuitem, sizeof(menuitem), "%s\n %s", classname, description); + Format(menuitem, sizeof(menuitem), "%s\n %s", classname, classident, description); AddMenuItem(menu, classident, menuitem); } } @@ -342,7 +342,7 @@ ClassMenuSelect(client, teamid) */ public ClassMenuSelectHandle(Handle:menu, MenuAction:action, client, slot) { - decl String:classIdent[MENU_LINE_REG_LENGTH]; + decl String:classIdent[64]; new classIndex; new bool:autoclose = GetConVarBool(g_hCvarsList[CVAR_CLASSES_MENU_AUTOCLOSE]); diff --git a/src/zr/playerclasses/playerclasses.inc b/src/zr/playerclasses/playerclasses.inc index c52c8e1..039df5a 100644 --- a/src/zr/playerclasses/playerclasses.inc +++ b/src/zr/playerclasses/playerclasses.inc @@ -1238,17 +1238,17 @@ ClassClientSetDefaultIdentifiers(client = -1) { if (!haszombie && zombieindex != -1) { - ClassGetIdentifier(zombieindex, zombie_ident, sizeof(zombie_ident)); + ClassGetIdentifier(zombieindex, zombie_ident, sizeof(zombie_ident), ZR_CLASS_CACHE_MODIFIED); SetClientCookie(client, g_hClassCookieClassSelected[ZR_CLASS_TEAM_ZOMBIES], zombie_ident); } if (!hashuman && humanindex != -1) { - ClassGetIdentifier(humanindex, human_ident, sizeof(human_ident)); + ClassGetIdentifier(humanindex, human_ident, sizeof(human_ident), ZR_CLASS_CACHE_MODIFIED); SetClientCookie(client, g_hClassCookieClassSelected[ZR_CLASS_TEAM_HUMANS], human_ident); } if (!hasadmin && adminindex != -1) { - ClassGetIdentifier(adminindex, admin_ident, sizeof(admin_ident)); + ClassGetIdentifier(adminindex, admin_ident, sizeof(admin_ident), ZR_CLASS_CACHE_MODIFIED); SetClientCookie(client, g_hClassCookieClassSelected[ZR_CLASS_TEAM_ADMINS], admin_ident); } } @@ -1343,7 +1343,9 @@ ClassSelectResult:ClassSelectClientClass(client, classIndex, bool:applyIfPossibl // Note: Saved indexes are increased by one. if (saveIfEnabled && GetConVarBool(g_hCvarsList[CVAR_CLASSES_SAVE])) { - CookiesSetInt(client, g_hClassCookieClassSelected[teamid], classIndex + 1); + char classIdent[64]; + ClassGetIdentifier(classIndex, classIdent, sizeof(classIdent), ZR_CLASS_CACHE_MODIFIED); + SetClientCookie(client, g_hClassCookieClassSelected[teamid], classIdent); } return selectResult;