mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-21 07:22:33 +00:00
Restore SPB force-seek define as 'spbtest' cvar
This commit is contained in:
parent
1300ec5d56
commit
6a7c5050ad
4 changed files with 65 additions and 57 deletions
|
|
@ -455,6 +455,9 @@ consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_C
|
|||
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_CHEAT, CV_OnOff, NULL);
|
||||
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_CHEAT, CV_OnOff, NULL);
|
||||
consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", CV_CHEAT, CV_OnOff, NULL);
|
||||
#ifdef DEVELOP
|
||||
consvar_t cv_spbtest = CVAR_INIT ("spbtest", "Off", CV_CHEAT, CV_OnOff, NULL);
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL);
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ extern consvar_t cv_kartusepwrlv;
|
|||
extern consvar_t cv_votetime;
|
||||
|
||||
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugdistribution, cv_kartdebughuddrop;
|
||||
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector;
|
||||
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector, cv_spbtest;
|
||||
extern consvar_t cv_kartdebugwaypoints, cv_kartdebugbotpredict;
|
||||
|
||||
extern consvar_t cv_itemfinder;
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ void K_RegisterKartStuff(void)
|
|||
CV_RegisterVar(&cv_kartdebugnodes);
|
||||
CV_RegisterVar(&cv_kartdebugcolorize);
|
||||
CV_RegisterVar(&cv_kartdebugdirector);
|
||||
CV_RegisterVar(&cv_spbtest);
|
||||
}
|
||||
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@
|
|||
#include "../k_waypoint.h"
|
||||
#include "../k_respawn.h"
|
||||
|
||||
// #define SPB_SEEKTEST
|
||||
|
||||
#define SPB_SLIPTIDEDELTA (ANG1 * 3)
|
||||
#define SPB_STEERDELTA (ANGLE_90 - ANG10)
|
||||
#define SPB_DEFAULTSPEED (FixedMul(mapobjectscale, K_GetKartSpeedFromStat(9) * 2))
|
||||
|
|
@ -107,8 +105,8 @@ static void SPBMantaRings(mobj_t *spb)
|
|||
Obj_MantaRingCreate(
|
||||
spb,
|
||||
spb_owner(spb),
|
||||
#ifdef SPB_SEEKTEST
|
||||
NULL
|
||||
#ifdef DEVELOP
|
||||
cv_spbtest.value ? NULL : spb_chase(spb)
|
||||
#else
|
||||
spb_chase(spb)
|
||||
#endif
|
||||
|
|
@ -360,8 +358,11 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
spb->fuse = 2*TICRATE;
|
||||
}
|
||||
}
|
||||
#ifndef SPB_SEEKTEST // Easy debug switch
|
||||
#ifdef DEVELOP
|
||||
else if (!cv_spbtest.value)
|
||||
#else
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (dist <= activeDist)
|
||||
{
|
||||
|
|
@ -378,7 +379,6 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (SPBSeekSoundPlaying(spb) == false)
|
||||
{
|
||||
|
|
@ -441,64 +441,68 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
|
||||
if (pathfindsuccess == true)
|
||||
{
|
||||
#ifdef SPB_SEEKTEST
|
||||
if (pathtoplayer.numnodes > 1)
|
||||
{
|
||||
// Go to the next waypoint.
|
||||
curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata;
|
||||
}
|
||||
else if (destWaypoint->numnextwaypoints > 0)
|
||||
{
|
||||
// Run ahead.
|
||||
curWaypoint = destWaypoint->nextwaypoints[0];
|
||||
#ifdef DEVELOP
|
||||
if (cv_spbtest.value) {
|
||||
if (pathtoplayer.numnodes > 1)
|
||||
{
|
||||
// Go to the next waypoint.
|
||||
curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata;
|
||||
}
|
||||
else if (destWaypoint->numnextwaypoints > 0)
|
||||
{
|
||||
// Run ahead.
|
||||
curWaypoint = destWaypoint->nextwaypoints[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sort of wait at the player's dest waypoint.
|
||||
circling = true;
|
||||
curWaypoint = destWaypoint;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sort of wait at the player's dest waypoint.
|
||||
circling = true;
|
||||
curWaypoint = destWaypoint;
|
||||
}
|
||||
#else
|
||||
path_t reversepath = {0};
|
||||
boolean reversesuccess = false;
|
||||
{
|
||||
path_t reversepath = {0};
|
||||
boolean reversesuccess = false;
|
||||
|
||||
huntbackwards = true;
|
||||
reversesuccess = K_PathfindToWaypoint(
|
||||
curWaypoint, destWaypoint,
|
||||
&reversepath,
|
||||
useshortcuts, huntbackwards
|
||||
);
|
||||
huntbackwards = true;
|
||||
reversesuccess = K_PathfindToWaypoint(
|
||||
curWaypoint, destWaypoint,
|
||||
&reversepath,
|
||||
useshortcuts, huntbackwards
|
||||
);
|
||||
|
||||
if (reversesuccess == true
|
||||
&& reversepath.totaldist < pathtoplayer.totaldist)
|
||||
{
|
||||
// It's faster to go backwards than to chase forward.
|
||||
// Keep curWaypoint the same, so the SPB waits around for them.
|
||||
circling = true;
|
||||
}
|
||||
else if (pathtoplayer.numnodes > 1)
|
||||
{
|
||||
// Go to the next waypoint.
|
||||
curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata;
|
||||
}
|
||||
else if (spb->fuse > 0 && destWaypoint->numnextwaypoints > 0)
|
||||
{
|
||||
// Run ahead.
|
||||
curWaypoint = destWaypoint->nextwaypoints[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sort of wait at the player's dest waypoint.
|
||||
circling = true;
|
||||
curWaypoint = destWaypoint;
|
||||
}
|
||||
if (reversesuccess == true
|
||||
&& reversepath.totaldist < pathtoplayer.totaldist)
|
||||
{
|
||||
// It's faster to go backwards than to chase forward.
|
||||
// Keep curWaypoint the same, so the SPB waits around for them.
|
||||
circling = true;
|
||||
}
|
||||
else if (pathtoplayer.numnodes > 1)
|
||||
{
|
||||
// Go to the next waypoint.
|
||||
curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata;
|
||||
}
|
||||
else if (spb->fuse > 0 && destWaypoint->numnextwaypoints > 0)
|
||||
{
|
||||
// Run ahead.
|
||||
curWaypoint = destWaypoint->nextwaypoints[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sort of wait at the player's dest waypoint.
|
||||
circling = true;
|
||||
curWaypoint = destWaypoint;
|
||||
}
|
||||
|
||||
if (reversesuccess == true)
|
||||
{
|
||||
Z_Free(reversepath.array);
|
||||
if (reversesuccess == true)
|
||||
{
|
||||
Z_Free(reversepath.array);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Z_Free(pathtoplayer.array);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue