Fix double free occuring when unloading the intermission patches due to the same patch being cached twice
This commit is contained in:
parent
d004515d6a
commit
c2de684150
|
@ -1229,7 +1229,10 @@ void Y_StartIntermission(void)
|
||||||
data.coop.tics = players[consoleplayer].realtime;
|
data.coop.tics = players[consoleplayer].realtime;
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
data.coop.bonuspatches[i] = W_CachePatchName(data.coop.bonuses[i].patch, PU_PATCH);
|
{
|
||||||
|
if (strlen(data.coop.bonuses[i].patch))
|
||||||
|
data.coop.bonuspatches[i] = W_CachePatchName(data.coop.bonuses[i].patch, PU_PATCH);
|
||||||
|
}
|
||||||
data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_PATCH);
|
data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_PATCH);
|
||||||
|
|
||||||
// get act number
|
// get act number
|
||||||
|
@ -1733,7 +1736,6 @@ static void Y_SetNullBonus(player_t *player, y_bonus_t *bstruct)
|
||||||
{
|
{
|
||||||
(void)player;
|
(void)player;
|
||||||
memset(bstruct, 0, sizeof(y_bonus_t));
|
memset(bstruct, 0, sizeof(y_bonus_t));
|
||||||
strncpy(bstruct->patch, "MISSING", sizeof(bstruct->patch));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue