From 84a91291855def0dd4c4064f882982ccea4dfef0 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 f6c89b38e..1758f4718 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1812,7 +1812,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; } @@ -5697,19 +5697,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.