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,10 +790,20 @@ static void SPBChase(mobj_t *spb, mobj_t *bestMobj)
desiredSpeed = 20 * chase->scale; desiredSpeed = 20 * chase->scale;
} }
if (chasePlayer != NULL && chasePlayer->carry == CR_SLIDING) if (chasePlayer != NULL)
{ {
// Hack for current sections to make them fair. if (chasePlayer->carry == CR_SLIDING)
desiredSpeed = min(desiredSpeed, chasePlayer->speed / 2); {
// 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); destAngle = R_PointToAngle2(spb->x, spb->y, chase->x, chase->y);

View file

@ -13378,6 +13378,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
mobj->movefactor = 0; 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 // 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(&mobj->tracer, waypointcap);
P_SetTarget(&waypointcap, mobj); P_SetTarget(&waypointcap, mobj);