Do not corrupt spraycan cache when freeslotting custom skincolours

My mistake gomen
This commit is contained in:
toaster 2024-08-18 16:16:25 +01:00
parent e4b81494d6
commit 02043af2f7
2 changed files with 2 additions and 2 deletions

View file

@ -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++;

View file

@ -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;
}