Only prevent respawn if spun out in midair and added a Got_Respawn check to kick cheaters

This commit is contained in:
Latapostrophe 2019-01-26 17:40:05 +01:00
parent e7d730e3b2
commit 9028783190

View file

@ -2490,18 +2490,18 @@ static void Command_Respawn(void)
WRITEINT32(cp, consoleplayer); WRITEINT32(cp, consoleplayer);
if (players[consoleplayer].kartstuff[k_spinouttimer]) // KART: Nice try, but no, you won't be cheesing spb anymore.
{
CONS_Printf(M_GetText("Cannot use this while hurt.\n"));
return;
}
if (!(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING)) if (!(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING))
{ {
CONS_Printf(M_GetText("You must be in a level to use this.\n")); CONS_Printf(M_GetText("You must be in a level to use this.\n"));
return; return;
} }
if (players[consoleplayer].kartstuff[k_spinouttimer] && !P_IsObjectOnGround(players[consoleplayer].mo)) // KART: Nice try, but no, you won't be cheesing spb anymore.
{
CONS_Printf(M_GetText("Cannot use this while hurt.\n"));
return;
}
/*if (!G_RaceGametype()) // srb2kart: not necessary, respawning makes you lose a bumper in battle, so it's not desirable to use as a way to escape a hit /*if (!G_RaceGametype()) // srb2kart: not necessary, respawning makes you lose a bumper in battle, so it's not desirable to use as a way to escape a hit
{ {
CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n")); CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n"));
@ -2523,8 +2523,8 @@ static void Got_Respawn(UINT8 **cp, INT32 playernum)
{ {
INT32 respawnplayer = READINT32(*cp); INT32 respawnplayer = READINT32(*cp);
// You can't respawn someone else. Nice try, there. // You can't respawn someone else or cheat your way by removing the send checks above :) Nice try, there.
if (respawnplayer != playernum) // srb2kart: "|| (!G_RaceGametype())" if ((respawnplayer != playernum) || (players[respawnplayer].mo && players[respawnplayer].kartstuff[k_spinouttimer] && !P_IsObjectOnGround(players[respawnplayer].mo))) // srb2kart: "|| (!G_RaceGametype())"
{ {
CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]); CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]);
if (server) if (server)