From 453f673219b11d3320cabc3ae639b21892def99e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 24 Apr 2017 21:05:28 +0100 Subject: [PATCH] Spinning/swinging maces/chains can now use P_FindSpecialLineFromTag! # Conflicts: # src/p_mobj.c --- src/p_mobj.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index e1ac3f2db..3d309f0d1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11531,20 +11531,16 @@ void P_SpawnMapThing(mapthing_t *mthing) mobjtype_t macetype = MT_SMALLMACE; boolean firsttime; mobj_t *spawnee; - size_t line; + INT32 line; const size_t mthingi = (size_t)(mthing - mapthings); - // Why does P_FindSpecialLineFromTag not work here?!? - // Monster Iestyn: tag lists haven't been initialised yet for the map, that's why - for (line = 0; line < numlines; line++) - { - if (lines[line].special == 9 && lines[line].tag == mthing->angle) - break; - } + // Find the corresponding linedef special, using angle as tag + // P_FindSpecialLineFromTag works here now =D + line = P_FindSpecialLineFromTag(9, mthing->angle, -1); - if (line == numlines) + if (line == -1) { - CONS_Debug(DBG_GAMELOGIC, "Mace chain (mapthing #%s) needs tagged to a #9 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle); + CONS_Debug(DBG_GAMELOGIC, "Mace chain (mapthing #%s) needs to be tagged to a #9 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle); return; } /*