fix losing check to prevent lost lives
This commit is contained in:
parent
914a4fa9e1
commit
4577eaa275
1 changed files with 11 additions and 18 deletions
29
src/p_user.c
29
src/p_user.c
|
|
@ -1251,7 +1251,7 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
|
||||||
// Player exits the map via sector trigger
|
// Player exits the map via sector trigger
|
||||||
void P_DoPlayerExit(player_t *player)
|
void P_DoPlayerExit(player_t *player)
|
||||||
{
|
{
|
||||||
const boolean losing = K_IsPlayerLosing(player);
|
boolean losing;
|
||||||
|
|
||||||
if (player->exiting || mapreset)
|
if (player->exiting || mapreset)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1263,30 +1263,23 @@ void P_DoPlayerExit(player_t *player)
|
||||||
player->griefstrikes--; // Remove a strike for finishing a race normally
|
player->griefstrikes--; // Remove a strike for finishing a race normally
|
||||||
|
|
||||||
player->exiting = 1;
|
player->exiting = 1;
|
||||||
|
|
||||||
|
if (!player->spectator && (gametyperules & GTR_CIRCUIT)) // Special Race-like handling
|
||||||
|
{
|
||||||
|
K_UpdateAllPlayerPositions();
|
||||||
|
}
|
||||||
|
|
||||||
|
losing = K_IsPlayerLosing(player); // HEY!!!! Set it AFTER K_UpdateAllPlayerPositions!!!!
|
||||||
|
|
||||||
if (!player->spectator)
|
if (!player->spectator)
|
||||||
{
|
{
|
||||||
if ((gametyperules & GTR_CIRCUIT)) // If in Race Mode, allow
|
if ((gametyperules & GTR_CIRCUIT)) // If in Race Mode, allow
|
||||||
{
|
{
|
||||||
K_UpdateAllPlayerPositions();
|
|
||||||
if (cv_kartvoices.value)
|
if (cv_kartvoices.value)
|
||||||
{
|
{
|
||||||
if (P_IsDisplayPlayer(player))
|
const INT32 sfx_id = (losing ? sfx_klose : sfx_kwin);
|
||||||
{
|
skin_t *playerskin = &skins[player->skin];
|
||||||
sfxenum_t sfx_id;
|
S_StartSound(player->mo, playerskin->soundsid[S_sfx[sfx_id].skinsound]);
|
||||||
if (losing)
|
|
||||||
sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_klose].skinsound];
|
|
||||||
else
|
|
||||||
sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_kwin].skinsound];
|
|
||||||
S_StartSound(NULL, sfx_id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (losing)
|
|
||||||
S_StartSound(player->mo, sfx_klose);
|
|
||||||
else
|
|
||||||
S_StartSound(player->mo, sfx_kwin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!K_CanChangeRules() || cv_inttime.value > 0)
|
if (!K_CanChangeRules() || cv_inttime.value > 0)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue