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