Merge branch 'loop-netsave' into 'master'

MT_LOOPCENTERPOINT invalid spawnpoint (resolves #563)

Closes #563

See merge request KartKrew/Kart!1338
This commit is contained in:
toaster 2023-07-18 09:45:41 +00:00
commit c20a76586c
2 changed files with 22 additions and 11 deletions

View file

@ -13788,8 +13788,15 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numi
y + FixedMul(length, FINESINE(fineangle)),
z, MT_LOOPCENTERPOINT);
if (!P_MobjWasRemoved(loopanchor))
Obj_LinkLoopAnchor(loopanchor, loopcenter, mthing->args[0]);
if (P_MobjWasRemoved(loopanchor))
{
// No recovery.
return;
}
loopanchor->spawnpoint = NULL;
Obj_LinkLoopAnchor(loopanchor, loopcenter, mthing->args[0]);
}
for (r = 0; r < numitems; r++)
@ -13809,15 +13816,15 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numi
if (!inclusive)
mobj = P_SpawnMobjFromMapThing(&dummything, x, y, z, itemtype);
if (!mobj)
if (P_MobjWasRemoved(mobj))
continue;
if (isloopend)
{
Obj_InitLoopEndpoint(mobj, loopanchor);
}
mobj->spawnpoint = NULL;
if (!isloopend)
continue;
Obj_InitLoopEndpoint(mobj, loopanchor);
}
}
@ -13875,11 +13882,12 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
mobj = P_SpawnMobjFromMapThing(&dummything, x + v[0], y + v[1], z + v[2], itemtype);
if (!mobj)
if (P_MobjWasRemoved(mobj))
continue;
mobj->z -= mobj->height/2;
mobj->spawnpoint = NULL;
mobj->z -= mobj->height/2;
}
}

View file

@ -4074,7 +4074,10 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
if (diff2 & MD2_RENDERFLAGS)
mobj->renderflags = READUINT32(save->p);
if (diff2 & MD2_TID)
P_SetThingTID(mobj, READINT16(save->p));
{
INT16 tid = READINT16(save->p);
P_SetThingTID(mobj, tid);
}
if (diff2 & MD2_SPRITESCALE)
{
mobj->spritexscale = READFIXED(save->p);