mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Waypoint spawning update
Use Linedef Action 2000 as Waypoint Parameters to set height and radius, instead of having separate mobjs use movecount as current ID instead
This commit is contained in:
parent
c0dc643295
commit
71851fb20c
3 changed files with 29 additions and 32 deletions
31
src/p_mobj.c
31
src/p_mobj.c
|
|
@ -10222,7 +10222,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
else
|
||||
mthing->z = (INT16)(z>>FRACBITS);
|
||||
}
|
||||
else if (i == MT_WAYPOINT && !(mthing->options & MTF_OBJECTSPECIAL))
|
||||
else if (i == MT_WAYPOINT)
|
||||
{
|
||||
// just gets set on either the floor or ceiling
|
||||
boolean flip = (!!(mobjinfo[i].flags & MF_SPAWNCEILING) ^ !!(mthing->options & MTF_OBJECTFLIP));
|
||||
|
|
@ -10496,13 +10496,31 @@ ML_NOCLIMB : Direction not controllable
|
|||
mobj->tics += 7*(mthing->angle / 360) + 1; // starting delay
|
||||
break;
|
||||
case MT_WAYPOINT:
|
||||
if (!(mthing->options & MTF_OBJECTSPECIAL))
|
||||
{
|
||||
size_t line;
|
||||
mobj->radius = 256*FRACUNIT;
|
||||
// Same reason as for MT_SPINMACEPOINT we can't use the function to find the linedef
|
||||
for (line = 0; line < numlines; line++)
|
||||
{
|
||||
// Z is already altered to account for proper height
|
||||
// Use threshold to store the previous waypoint ID
|
||||
// Angle is being used for the current waypoint ID
|
||||
mobj->threshold = ((mthing->options >> ZSHIFT));
|
||||
if (lines[line].special == 2000 && lines[line].tag == mthing->angle)
|
||||
break;
|
||||
}
|
||||
// Set the radius, mobj z, and mthing z to match what the parameters want
|
||||
if (line < numlines)
|
||||
{
|
||||
fixed_t lineradius = sides[lines[line].sidenum[0]].textureoffset;
|
||||
fixed_t linez = sides[lines[line].sidenum[0]].rowoffset;
|
||||
|
||||
if (lineradius > 0)
|
||||
mobj->radius = lineradius;
|
||||
mobj->z += linez;
|
||||
mthing->z += linez >> FRACBITS;
|
||||
}
|
||||
// Use threshold to store the next waypoint ID
|
||||
// movecount is being used for the current waypoint ID
|
||||
// reactiontime lets us know if we can respawn at it
|
||||
mobj->threshold = ((mthing->options >> ZSHIFT));
|
||||
mobj->movecount = mthing->angle;
|
||||
if (mthing->options & MTF_AMBUSH)
|
||||
{
|
||||
mobj->reactiontime = 1;
|
||||
|
|
@ -10512,6 +10530,7 @@ ML_NOCLIMB : Direction not controllable
|
|||
mobj->reactiontime = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -923,24 +923,6 @@ void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void P_SetWaypointsHeight(mapthing_t *mt)
|
||||
{
|
||||
mapthing_t *mt2 = mapthings;
|
||||
size_t i;
|
||||
for (i = 0; i < nummapthings; i++, mt2++)
|
||||
{
|
||||
if (!(mt2->type == mobjinfo[MT_WAYPOINT].doomednum && (mt2->options & MTF_OBJECTSPECIAL)))
|
||||
continue;
|
||||
|
||||
if (mt->angle == mt2->angle) // same waypoint id
|
||||
{
|
||||
mt->z = mt2->z;
|
||||
mt->mobj->z = mt2->mobj->z;
|
||||
P_RemoveMobj(mt2->mobj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// P_LoadThings
|
||||
//
|
||||
|
|
@ -1079,12 +1061,6 @@ static void P_LoadThings(void)
|
|||
|
||||
P_SpawnHoopsAndRings (mt);
|
||||
}
|
||||
|
||||
if (mt->type == mobjinfo[MT_WAYPOINT].doomednum && !(mt->options & MTF_OBJECTSPECIAL))
|
||||
{
|
||||
// use any "2nd" waypoint mobjs to set the height of original, then remove the 2nds mobjs
|
||||
P_SetWaypointsHeight(mt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1709,14 +1709,14 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
|||
{
|
||||
if (maptol & TOL_NIGHTS)
|
||||
lap = actor->player->mare;
|
||||
else
|
||||
else
|
||||
lap = actor->player->laps;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (maptol & TOL_NIGHTS)
|
||||
lap = P_FindLowestMare();
|
||||
else
|
||||
else
|
||||
lap = P_FindLowestLap();
|
||||
}
|
||||
|
||||
|
|
@ -6566,6 +6566,8 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
break;
|
||||
#endif
|
||||
|
||||
case 2000: // Waypoint Parameters
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue