From 02043af2f77e813b79c29836ccd0fd917bb6be56 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 18 Aug 2024 16:16:25 +0100 Subject: [PATCH] Do not corrupt spraycan cache when freeslotting custom skincolours My mistake gomen --- src/deh_lua.c | 2 +- src/deh_soc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deh_lua.c b/src/deh_lua.c index 6c97cda93..224d0c010 100644 --- a/src/deh_lua.c +++ b/src/deh_lua.c @@ -143,7 +143,7 @@ static inline int lib_freeslot(lua_State *L) CONS_Printf("Skincolor SKINCOLOR_%s allocated.\n",word); FREE_SKINCOLORS[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL); strcpy(FREE_SKINCOLORS[i],word); - skincolors[i].cache_spraycan = UINT16_MAX; + skincolors[SKINCOLOR_FIRSTFREESLOT+i].cache_spraycan = UINT16_MAX; numskincolors++; lua_pushinteger(L, SKINCOLOR_FIRSTFREESLOT + i); r++; diff --git a/src/deh_soc.c b/src/deh_soc.c index b0e7a473a..32475d0a6 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -334,7 +334,7 @@ void readfreeslots(MYFILE *f) CONS_Printf("Skincolor SKINCOLOR_%s allocated.\n",word); FREE_SKINCOLORS[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL); strcpy(FREE_SKINCOLORS[i],word); - skincolors[i].cache_spraycan = UINT16_MAX; + skincolors[SKINCOLOR_FIRSTFREESLOT+i].cache_spraycan = UINT16_MAX; numskincolors++; break; }