mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-05 13:16:16 +00:00
Items respawn in GP
This commit is contained in:
parent
482141a95f
commit
e51bceb567
4 changed files with 20 additions and 30 deletions
|
|
@ -682,8 +682,6 @@ void D_RegisterServerCommands(void)
|
|||
AddMServCommands();
|
||||
|
||||
// p_mobj.c
|
||||
CV_RegisterVar(&cv_itemrespawntime);
|
||||
CV_RegisterVar(&cv_itemrespawn);
|
||||
CV_RegisterVar(&cv_flagtime);
|
||||
CV_RegisterVar(&cv_suddendeath);
|
||||
|
||||
|
|
@ -5152,11 +5150,6 @@ void D_GameTypeChanged(INT32 lastgametype)
|
|||
// There will always be a server, and this only needs to be done once.
|
||||
if (server && (multiplayer || netgame))
|
||||
{
|
||||
if (gametype == GT_COMPETITION || gametype == GT_COOP)
|
||||
CV_SetValue(&cv_itemrespawn, 0);
|
||||
else if (!cv_itemrespawn.changed)
|
||||
CV_SetValue(&cv_itemrespawn, 1);
|
||||
|
||||
switch (gametype)
|
||||
{
|
||||
case GT_MATCH:
|
||||
|
|
@ -5167,8 +5160,6 @@ void D_GameTypeChanged(INT32 lastgametype)
|
|||
CV_SetValue(&cv_pointlimit, 0);
|
||||
CV_SetValue(&cv_timelimit, 120);
|
||||
}
|
||||
if (!cv_itemrespawntime.changed)
|
||||
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
|
||||
break;
|
||||
case GT_TAG:
|
||||
case GT_HIDEANDSEEK:
|
||||
|
|
@ -5179,8 +5170,6 @@ void D_GameTypeChanged(INT32 lastgametype)
|
|||
CV_SetValue(&cv_timelimit, 5);
|
||||
CV_SetValue(&cv_pointlimit, 0);
|
||||
}
|
||||
if (!cv_itemrespawntime.changed)
|
||||
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
|
||||
break;
|
||||
case GT_CTF:
|
||||
if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits
|
||||
|
|
@ -5189,17 +5178,12 @@ void D_GameTypeChanged(INT32 lastgametype)
|
|||
CV_SetValue(&cv_timelimit, 0);
|
||||
CV_SetValue(&cv_pointlimit, 5);
|
||||
}
|
||||
if (!cv_itemrespawntime.changed)
|
||||
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!multiplayer && !netgame)
|
||||
{
|
||||
gametype = GT_RACE; // SRB2kart
|
||||
// These shouldn't matter anymore
|
||||
//CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue);
|
||||
//CV_SetValue(&cv_itemrespawn, 0);
|
||||
gametype = GT_RACE;
|
||||
}
|
||||
|
||||
// reset timelimit and pointlimit in race/coop, prevent stupid cheats
|
||||
|
|
|
|||
|
|
@ -60,10 +60,6 @@ extern consvar_t cv_usemouse2;
|
|||
extern consvar_t cv_mouse2opt;
|
||||
#endif
|
||||
|
||||
// normally in p_mobj but the .h is not read
|
||||
extern consvar_t cv_itemrespawntime;
|
||||
extern consvar_t cv_itemrespawn;
|
||||
|
||||
extern consvar_t cv_flagtime;
|
||||
extern consvar_t cv_suddendeath;
|
||||
|
||||
|
|
|
|||
|
|
@ -2217,11 +2217,28 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
|||
{
|
||||
if (target->flags & MF_MONITOR || target->type == MT_RANDOMITEM)
|
||||
{
|
||||
UINT8 i;
|
||||
|
||||
P_SetTarget(&target->target, source);
|
||||
source->player->numboxes++;
|
||||
if (cv_itemrespawn.value && (netgame || multiplayer))
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
target->fuse = cv_itemrespawntime.value*TICRATE + 2; // Random box generation
|
||||
if (&players[i] == source->player)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (playeringame[i] && !players[i].spectator && players[i].lives != 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < MAXPLAYERS)
|
||||
{
|
||||
// Respawn items in multiplayer, don't respawn them when alone
|
||||
target->fuse = 2*TICRATE + 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11377,9 +11377,6 @@ void P_RemoveSavegameMobj(mobj_t *mobj)
|
|||
P_RemoveThinker((thinker_t *)mobj);
|
||||
}
|
||||
|
||||
static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_itemrespawntime = {"respawnitemtime", "2", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_itemrespawn = {"respawnitem", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t flagtime_cons_t[] = {{0, "MIN"}, {300, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_flagtime = {"flagtime", "30", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, flagtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_suddendeath = {"suddendeath", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
|
@ -11650,10 +11647,6 @@ void P_RespawnSpecials(void)
|
|||
time = (time * 3) / max(1, mapheaderinfo[gamemap-1]->numlaps);
|
||||
}
|
||||
|
||||
// only respawn items when cv_itemrespawn is on
|
||||
//if (!cv_itemrespawn.value) // TODO: remove this cvar
|
||||
//return;
|
||||
|
||||
// nothing left to respawn?
|
||||
if (iquehead == iquetail)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue