Merge branch 'spb-speed' into 'master'

Waypoints: thingarg3 is SPB speed (0-100)

Closes #767

See merge request KartKrew/Kart!1963
This commit is contained in:
Oni 2024-02-29 00:08:12 +00:00
commit 1da25c45ca
2 changed files with 15 additions and 3 deletions

View file

@ -790,12 +790,22 @@ static void SPBChase(mobj_t *spb, mobj_t *bestMobj)
desiredSpeed = 20 * chase->scale;
}
if (chasePlayer != NULL && chasePlayer->carry == CR_SLIDING)
if (chasePlayer != NULL)
{
if (chasePlayer->carry == CR_SLIDING)
{
// Hack for current sections to make them fair.
desiredSpeed = min(desiredSpeed, chasePlayer->speed / 2);
}
const mobj_t *waypoint = chasePlayer->currentwaypoint ? chasePlayer->currentwaypoint->mobj : NULL;
// thing_args[3]: SPB speed (0-100)
if (waypoint && waypoint->thing_args[3]) // 0 = default speed (unchanged)
{
desiredSpeed = desiredSpeed * waypoint->thing_args[3] / 100;
}
}
destAngle = R_PointToAngle2(spb->x, spb->y, chase->x, chase->y);
destPitch = R_PointToAngle2(0, spb->z, P_AproxDistance(spb->x - chase->x, spb->y - chase->y), chase->z);

View file

@ -13378,6 +13378,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
mobj->movefactor = 0;
}
// thing_args[3]: SPB speed (objects/spb.c)
// Sryder 2018-12-7: Grabbed this from the old MT_BOSS3WAYPOINT section so they'll be in the waypointcap instead
P_SetTarget(&mobj->tracer, waypointcap);
P_SetTarget(&waypointcap, mobj);