From f8922c83c893a1da3583caec8023104fab5be77b Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 17 Jul 2023 13:53:13 +0100 Subject: [PATCH] MD2_TID: Don't pass a macro directly to P_SetThingTID This isn't currently the cause of any issue, but found this future footgun while researching the previous commit. Sometimes functions are turned into macros, which could potentially result in multiple save->p digestions if this was eventually turned into one. --- src/p_saveg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 885b7b5c0..655e915ff 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -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);