mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Fix segfault when first mobj in overlaycap is removed
This commit is contained in:
parent
b98af785f5
commit
cb849ca4f0
1 changed files with 7 additions and 0 deletions
|
@ -6900,6 +6900,13 @@ static void P_AddOverlay(mobj_t *thing)
|
|||
static void P_RemoveOverlay(mobj_t *thing)
|
||||
{
|
||||
mobj_t *mo;
|
||||
if (overlaycap == thing)
|
||||
{
|
||||
P_SetTarget(&overlaycap, thing->hnext);
|
||||
P_SetTarget(&thing->hnext, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
for (mo = overlaycap; mo; mo = mo->hnext)
|
||||
{
|
||||
if (mo->hnext != thing)
|
||||
|
|
Loading…
Reference in a new issue