Spinning/swinging maces/chains and Particle generators can now use P_FindSpecialLineFromTag!

This commit is contained in:
Monster Iestyn 2017-04-24 21:05:28 +01:00
parent 13cb656f0b
commit f099782c91

View file

@ -9754,20 +9754,16 @@ void P_SpawnMapThing(mapthing_t *mthing)
mobjtype_t macetype = MT_SMALLMACE; mobjtype_t macetype = MT_SMALLMACE;
boolean firsttime; boolean firsttime;
mobj_t *spawnee; mobj_t *spawnee;
size_t line; INT32 line;
const size_t mthingi = (size_t)(mthing - mapthings); const size_t mthingi = (size_t)(mthing - mapthings);
// Why does P_FindSpecialLineFromTag not work here?!? // Find the corresponding linedef special, using angle as tag
// Monster Iestyn: tag lists haven't been initialised yet for the map, that's why // P_FindSpecialLineFromTag works here now =D
for (line = 0; line < numlines; line++) line = P_FindSpecialLineFromTag(9, mthing->angle, -1);
{
if (lines[line].special == 9 && lines[line].tag == mthing->angle)
break;
}
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; return;
} }
/* /*
@ -9865,18 +9861,15 @@ ML_NOCLIMB : Direction not controllable
fixed_t radius, speed, bottomheight, topheight; fixed_t radius, speed, bottomheight, topheight;
INT32 type, numdivisions, time, anglespeed; INT32 type, numdivisions, time, anglespeed;
angle_t angledivision; angle_t angledivision;
size_t line; INT32 line;
const size_t mthingi = (size_t)(mthing - mapthings); const size_t mthingi = (size_t)(mthing - mapthings);
for (line = 0; line < numlines; line++) // Find the corresponding linedef special, using angle as tag
{ line = P_FindSpecialLineFromTag(15, mthing->angle, -1);
if (lines[line].special == 15 && lines[line].tag == mthing->angle)
break;
}
if (line == numlines) if (line == -1)
{ {
CONS_Debug(DBG_GAMELOGIC, "Particle generator (mapthing #%s) needs tagged to a #15 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle); CONS_Debug(DBG_GAMELOGIC, "Particle generator (mapthing #%s) needs to be tagged to a #15 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle);
return; return;
} }