From df3a64339c7800a82448e77dee86ad2c8079b23e Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 20 Jul 2026 01:00:57 +0200 Subject: [PATCH] fix skin search command overflow when using localskins and going over the skinlimit this should use numskins not numallskins there no i dont feel like supporting localskins here the other skin commands also dont care --- src/d_netcmd.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 66e4aad3a..452263b75 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1806,7 +1806,7 @@ INT32 D_LookupPlayer(const char *s) if ((playernum = atoi(s))) { - playernum = max(min(playernum, MAXPLAYERS-1), 0);/* not out of range */ + playernum = max(min(playernum, MAXPLAYERS-1), 0); /* not out of range */ return playernum; } @@ -5691,19 +5691,22 @@ static void Command_SkinSearch(void) size_t i; UINT16 s; UINT16 ic = 0; - //skin_t *skininput = &skins[s]; - for (i = 1; i < COM_Argc(); i++){ - for( s = 0 ; s < numallskins ; s++ ) + + for (i = 1; i < COM_Argc(); i++) + { + for (s = 0; s < numskins; s++) { skin_t *skininput = &skins[s]; - if (strcasestr(skininput->realname,COM_Argv(i))) + + if (strcasestr(skininput->realname, COM_Argv(i))) { ic++; - CONS_Printf("%d. %s%s:\x80 %s\n", ic,HU_SkinColorToConsoleColor(skininput->prefcolor),skininput->realname,skininput->name); + CONS_Printf("%d. %s%s:\x80 %s\n", ic, HU_SkinColorToConsoleColor(skininput->prefcolor), skininput->realname, skininput->name); } } } - CONS_Printf("Total %d skins.\n", ic); + + CONS_Printf("Total %d skins.\n", ic); } /** Sends a color change for the console player, unless that player is moving.