Properly reset player skin

This commit is contained in:
Lactozilla 2023-11-27 13:22:46 -03:00
parent 57d913170b
commit 7524026e7e
2 changed files with 7 additions and 2 deletions

View file

@ -4409,8 +4409,10 @@ void G_AfterFileDeletion(void)
{
for (INT32 i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] && players[i].skin >= numskins)
SetPlayerSkinByNum(i, -1);
if (players[i].skin >= numskins)
SetPlayerSkinByNum(i, GetPlayerDefaultSkin(i));
else
SetPlayerSkinByNum(i, players[i].skin);
}
if (!Playing())

View file

@ -569,6 +569,9 @@ void R_InitSprites(void)
if (!numsprites)
I_Error("R_AddSpriteDefs: no sprites in namelist\n");
if (sprites)
Z_Free(sprites);
sprites = Z_Calloc(numsprites * sizeof (*sprites), PU_STATIC, NULL);
// find sprites in each -file added pwad