Merge branch 'no-cheese' into 'next'

No respawn cheese

See merge request KartKrew/Kart-Public!32
This commit is contained in:
Sryder 2019-01-26 16:08:36 -05:00
commit 90bdf11346
1 changed files with 11 additions and 1 deletions

View File

@ -2496,6 +2496,12 @@ static void Command_Respawn(void)
return;
}
if (players[consoleplayer].mo && !P_IsObjectOnGround(players[consoleplayer].mo)) // KART: Nice try, but no, you won't be cheesing spb anymore.
{
CONS_Printf(M_GetText("You must be on the floor to use this.\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
{
CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n"));
@ -2517,7 +2523,7 @@ static void Got_Respawn(UINT8 **cp, INT32 playernum)
{
INT32 respawnplayer = READINT32(*cp);
// You can't respawn someone else. Nice try, there.
// You can't respawn someone else. Nice try, there.
if (respawnplayer != playernum) // srb2kart: "|| (!G_RaceGametype())"
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]);
@ -2532,6 +2538,10 @@ static void Got_Respawn(UINT8 **cp, INT32 playernum)
return;
}
// incase the above checks were modified to allow sending a respawn on these occasions:
if (players[respawnplayer].mo && !P_IsObjectOnGround(players[respawnplayer].mo))
return;
if (players[respawnplayer].mo)
P_DamageMobj(players[respawnplayer].mo, NULL, NULL, 10000);
}