mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
very small tiny fixes
This commit is contained in:
parent
e949e3afb4
commit
1e4bc482d0
4 changed files with 15 additions and 4 deletions
|
|
@ -433,6 +433,7 @@ consvar_t cv_kartdebugbotpredict = CVAR_INIT ("kartdebugbotpredict", "Off", CV_N
|
||||||
consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
||||||
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
||||||
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
||||||
|
consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
||||||
|
|
||||||
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
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);
|
consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL);
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ extern consvar_t cv_kartusepwrlv;
|
||||||
extern consvar_t cv_votetime;
|
extern consvar_t cv_votetime;
|
||||||
|
|
||||||
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartallowgiveitem, cv_kartdebugshrink, cv_kartdebugdistribution, cv_kartdebughuddrop;
|
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartallowgiveitem, cv_kartdebugshrink, cv_kartdebugdistribution, cv_kartdebughuddrop;
|
||||||
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize;
|
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector;
|
||||||
extern consvar_t cv_kartdebugwaypoints, cv_kartdebugbotpredict;
|
extern consvar_t cv_kartdebugwaypoints, cv_kartdebugbotpredict;
|
||||||
|
|
||||||
extern consvar_t cv_itemfinder;
|
extern consvar_t cv_itemfinder;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ INT32 sortedplayers[MAXPLAYERS] = {0}; // position-1 goes in, player index comes
|
||||||
INT32 gap[MAXPLAYERS] = {0}; // gap between a given position and their closest pursuer
|
INT32 gap[MAXPLAYERS] = {0}; // gap between a given position and their closest pursuer
|
||||||
INT32 boredom[MAXPLAYERS] = {0}; // how long has a given position had no credible attackers?
|
INT32 boredom[MAXPLAYERS] = {0}; // how long has a given position had no credible attackers?
|
||||||
|
|
||||||
|
|
||||||
fixed_t K_GetFinishGap(INT32 leader, INT32 follower) {
|
fixed_t K_GetFinishGap(INT32 leader, INT32 follower) {
|
||||||
fixed_t dista = players[follower].distancetofinish;
|
fixed_t dista = players[follower].distancetofinish;
|
||||||
fixed_t distb = players[leader].distancetofinish;
|
fixed_t distb = players[leader].distancetofinish;
|
||||||
|
|
@ -75,12 +74,16 @@ boolean K_CanSwitchDirector(void) {
|
||||||
INT32 *displayplayerp = &displayplayers[0];
|
INT32 *displayplayerp = &displayplayers[0];
|
||||||
if (players[*displayplayerp].trickpanel > 0)
|
if (players[*displayplayerp].trickpanel > 0)
|
||||||
return false;
|
return false;
|
||||||
return cooldown >= SWITCHTIME;
|
if (cooldown < SWITCHTIME);
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void K_DirectorSwitch(INT32 player, boolean force) {
|
void K_DirectorSwitch(INT32 player, boolean force) {
|
||||||
if (P_IsDisplayPlayer(&players[player]))
|
if (P_IsDisplayPlayer(&players[player]))
|
||||||
return;
|
return;
|
||||||
|
if (players[player].exiting)
|
||||||
|
return;
|
||||||
if (!force && !K_CanSwitchDirector())
|
if (!force && !K_CanSwitchDirector())
|
||||||
return;
|
return;
|
||||||
G_ResetView(1, player, true);
|
G_ResetView(1, player, true);
|
||||||
|
|
@ -88,6 +91,8 @@ void K_DirectorSwitch(INT32 player, boolean force) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void K_DirectorForceSwitch(INT32 player, INT32 time) {
|
void K_DirectorForceSwitch(INT32 player, INT32 time) {
|
||||||
|
if (players[player].exiting)
|
||||||
|
return;
|
||||||
attacker = player;
|
attacker = player;
|
||||||
freeze = time;
|
freeze = time;
|
||||||
}
|
}
|
||||||
|
|
@ -106,6 +111,8 @@ void K_DrawDirectorDebugger(void) {
|
||||||
INT32 leader;
|
INT32 leader;
|
||||||
INT32 follower;
|
INT32 follower;
|
||||||
INT32 ytxt;
|
INT32 ytxt;
|
||||||
|
if (!cv_kartdebugdirector.value)
|
||||||
|
return;
|
||||||
V_DrawThinString(10, 0, V_70TRANS, va("PLACE"));
|
V_DrawThinString(10, 0, V_70TRANS, va("PLACE"));
|
||||||
V_DrawThinString(40, 0, V_70TRANS, va("CONF?"));
|
V_DrawThinString(40, 0, V_70TRANS, va("CONF?"));
|
||||||
V_DrawThinString(80, 0, V_70TRANS, va("GAP"));
|
V_DrawThinString(80, 0, V_70TRANS, va("GAP"));
|
||||||
|
|
@ -148,7 +155,7 @@ void K_UpdateDirector(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// aaight, time to walk through the standings to find the first interesting pair
|
// aaight, time to walk through the standings to find the first interesting pair
|
||||||
for(targetposition = 0; targetposition < MAXPLAYERS; targetposition++) {
|
for(targetposition = 0; targetposition < MAXPLAYERS-1; targetposition++) {
|
||||||
INT32 target;
|
INT32 target;
|
||||||
|
|
||||||
// you are out of players, try again
|
// you are out of players, try again
|
||||||
|
|
@ -163,9 +170,11 @@ void K_UpdateDirector(void) {
|
||||||
if (players[sortedplayers[targetposition+1]].exiting)
|
if (players[sortedplayers[targetposition+1]].exiting)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// don't risk switching away from forward pairs at race end, might miss something!
|
||||||
if (maxdist > PINCHDIST) {
|
if (maxdist > PINCHDIST) {
|
||||||
// if the "next" player is close enough, they should be able to see everyone fine!
|
// if the "next" player is close enough, they should be able to see everyone fine!
|
||||||
// walk back through the standings to find a vantage that gets everyone in frame.
|
// walk back through the standings to find a vantage that gets everyone in frame.
|
||||||
|
// (also creates a pretty cool effect w/ overtakes at speed)
|
||||||
while (targetposition < MAXPLAYERS && gap[targetposition+1] < WALKBACKDIST) {
|
while (targetposition < MAXPLAYERS && gap[targetposition+1] < WALKBACKDIST) {
|
||||||
targetposition++;
|
targetposition++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,7 @@ void K_RegisterKartStuff(void)
|
||||||
CV_RegisterVar(&cv_kartdebugcheckpoint);
|
CV_RegisterVar(&cv_kartdebugcheckpoint);
|
||||||
CV_RegisterVar(&cv_kartdebugnodes);
|
CV_RegisterVar(&cv_kartdebugnodes);
|
||||||
CV_RegisterVar(&cv_kartdebugcolorize);
|
CV_RegisterVar(&cv_kartdebugcolorize);
|
||||||
|
CV_RegisterVar(&cv_kartdebugdirector);
|
||||||
}
|
}
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue