mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
K_CheckBumpers, K_HandleBumperChanges: Make 2P behaviour in battle capsules mode function
- Only exit Capsules/Versus round if number of players with no bumpers is equal to number of players in game. - Apply Eliminated flags in relevant context, to prevent griefing.
This commit is contained in:
parent
e3eb3ed9f8
commit
1b2be7b6c9
2 changed files with 10 additions and 23 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
#include "m_random.h"
|
#include "m_random.h"
|
||||||
#include "r_sky.h" // skyflatnum
|
#include "r_sky.h" // skyflatnum
|
||||||
#include "k_grandprix.h" // K_CanChangeRules
|
#include "k_grandprix.h" // K_CanChangeRules
|
||||||
|
#include "k_boss.h" // bossinfo.valid
|
||||||
#include "p_spec.h"
|
#include "p_spec.h"
|
||||||
#include "k_objects.h"
|
#include "k_objects.h"
|
||||||
|
|
||||||
|
|
@ -92,7 +93,7 @@ void K_CheckBumpers(void)
|
||||||
UINT8 numingame = 0;
|
UINT8 numingame = 0;
|
||||||
SINT8 winnernum = -1;
|
SINT8 winnernum = -1;
|
||||||
UINT32 winnerscoreadd = 0, maxroundscore = 0;
|
UINT32 winnerscoreadd = 0, maxroundscore = 0;
|
||||||
boolean nobumpers = false;
|
UINT8 nobumpers = 0;
|
||||||
|
|
||||||
if (!(gametyperules & GTR_BUMPERS))
|
if (!(gametyperules & GTR_BUMPERS))
|
||||||
return;
|
return;
|
||||||
|
|
@ -118,7 +119,7 @@ void K_CheckBumpers(void)
|
||||||
|
|
||||||
if (players[i].bumpers <= 0) // if you don't have any bumpers, you're probably not a winner
|
if (players[i].bumpers <= 0) // if you don't have any bumpers, you're probably not a winner
|
||||||
{
|
{
|
||||||
nobumpers = true;
|
nobumpers++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (winnernum != -1) // TWO winners? that's dumb :V
|
else if (winnernum != -1) // TWO winners? that's dumb :V
|
||||||
|
|
@ -128,9 +129,9 @@ void K_CheckBumpers(void)
|
||||||
winnerscoreadd -= players[i].roundscore;
|
winnerscoreadd -= players[i].roundscore;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (K_CanChangeRules(true) == false)
|
if (battlecapsules || bossinfo.valid)
|
||||||
{
|
{
|
||||||
if (nobumpers)
|
if (nobumpers > 0 && nobumpers >= numingame)
|
||||||
{
|
{
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -144,29 +145,15 @@ void K_CheckBumpers(void)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (numingame <= 1)
|
|
||||||
|
if (numingame <= 1)
|
||||||
{
|
{
|
||||||
if ((gametyperules & GTR_CAPSULES) && !battlecapsules)
|
if ((gametyperules & GTR_CAPSULES) && (K_CanChangeRules(true) == true))
|
||||||
{
|
{
|
||||||
// Reset map to turn on battle capsules
|
// Reset map to turn on battle capsules
|
||||||
if (server)
|
if (server)
|
||||||
D_MapChange(gamemap, gametype, encoremode, true, 0, false, false);
|
D_MapChange(gamemap, gametype, encoremode, true, 0, false, false);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (nobumpers)
|
|
||||||
{
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
|
||||||
{
|
|
||||||
if (!playeringame[i])
|
|
||||||
continue;
|
|
||||||
if (players[i].spectator)
|
|
||||||
continue;
|
|
||||||
players[i].pflags |= PF_NOCONTEST;
|
|
||||||
P_DoPlayerExit(&players[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4192,9 +4192,9 @@ void K_HandleBumperChanges(player_t *player, UINT8 prevBumpers)
|
||||||
|
|
||||||
player->karmadelay = comebacktime;
|
player->karmadelay = comebacktime;
|
||||||
|
|
||||||
if (gametyperules & GTR_BOSS)
|
if (battlecapsules || bossinfo.valid)
|
||||||
{
|
{
|
||||||
P_DoTimeOver(player);
|
player->pflags |= (PF_NOCONTEST|PF_ELIMINATED);
|
||||||
}
|
}
|
||||||
else if (netgame)
|
else if (netgame)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue