mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
UCRP_REQUIRESPLAYING: Forbid some possible exiting states from happening in Free Play
This commit is contained in:
parent
53ce2e4287
commit
e1c25228b5
1 changed files with 31 additions and 2 deletions
29
src/m_cond.c
29
src/m_cond.c
|
|
@ -539,6 +539,28 @@ void M_UpdateConditionSetsPending(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean M_NotFreePlay(player_t *player)
|
||||||
|
{
|
||||||
|
UINT8 i;
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (playeringame[i] == false || players[i].spectator == true)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player == &players[i])
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// See also M_GetConditionString
|
// See also M_GetConditionString
|
||||||
boolean M_CheckCondition(condition_t *cn, player_t *player)
|
boolean M_CheckCondition(condition_t *cn, player_t *player)
|
||||||
{
|
{
|
||||||
|
|
@ -623,33 +645,40 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
||||||
case UCRP_FINISHCOOL:
|
case UCRP_FINISHCOOL:
|
||||||
return (player->exiting
|
return (player->exiting
|
||||||
&& !(player->pflags & PF_NOCONTEST)
|
&& !(player->pflags & PF_NOCONTEST)
|
||||||
|
&& M_NotFreePlay(player)
|
||||||
&& !K_IsPlayerLosing(player));
|
&& !K_IsPlayerLosing(player));
|
||||||
case UCRP_FINISHALLCAPSULES:
|
case UCRP_FINISHALLCAPSULES:
|
||||||
return (battlecapsules
|
return (battlecapsules
|
||||||
&& !(player->pflags & PF_NOCONTEST)
|
&& !(player->pflags & PF_NOCONTEST)
|
||||||
|
//&& M_NotFreePlay(player)
|
||||||
&& numtargets >= maptargets);
|
&& numtargets >= maptargets);
|
||||||
case UCRP_NOCONTEST:
|
case UCRP_NOCONTEST:
|
||||||
return (player->pflags & PF_NOCONTEST);
|
return (player->pflags & PF_NOCONTEST);
|
||||||
case UCRP_FINISHPLACE:
|
case UCRP_FINISHPLACE:
|
||||||
return (player->exiting
|
return (player->exiting
|
||||||
&& !(player->pflags & PF_NOCONTEST)
|
&& !(player->pflags & PF_NOCONTEST)
|
||||||
|
&& M_NotFreePlay(player)
|
||||||
&& player->position <= cn->requirement);
|
&& player->position <= cn->requirement);
|
||||||
case UCRP_FINISHPLACEEXACT:
|
case UCRP_FINISHPLACEEXACT:
|
||||||
return (player->exiting
|
return (player->exiting
|
||||||
&& !(player->pflags & PF_NOCONTEST)
|
&& !(player->pflags & PF_NOCONTEST)
|
||||||
|
&& M_NotFreePlay(player)
|
||||||
&& player->position == cn->requirement);
|
&& player->position == cn->requirement);
|
||||||
case UCRP_FINISHTIME:
|
case UCRP_FINISHTIME:
|
||||||
return (player->exiting
|
return (player->exiting
|
||||||
&& !(player->pflags & PF_NOCONTEST)
|
&& !(player->pflags & PF_NOCONTEST)
|
||||||
|
//&& M_NotFreePlay(player)
|
||||||
&& player->realtime <= (unsigned)cn->requirement);
|
&& player->realtime <= (unsigned)cn->requirement);
|
||||||
case UCRP_FINISHTIMEEXACT:
|
case UCRP_FINISHTIMEEXACT:
|
||||||
return (player->exiting
|
return (player->exiting
|
||||||
&& !(player->pflags & PF_NOCONTEST)
|
&& !(player->pflags & PF_NOCONTEST)
|
||||||
|
//&& M_NotFreePlay(player)
|
||||||
&& player->realtime == (unsigned)cn->requirement);
|
&& player->realtime == (unsigned)cn->requirement);
|
||||||
case UCRP_FINISHTIMELEFT:
|
case UCRP_FINISHTIMELEFT:
|
||||||
return (timelimitintics
|
return (timelimitintics
|
||||||
&& player->exiting
|
&& player->exiting
|
||||||
&& !(player->pflags & PF_NOCONTEST)
|
&& !(player->pflags & PF_NOCONTEST)
|
||||||
|
&& !K_CanChangeRules(false) // too easy to change cv_timelimit
|
||||||
&& player->realtime < timelimitintics
|
&& player->realtime < timelimitintics
|
||||||
&& (timelimitintics + extratimeintics + secretextratime - player->realtime) >= (unsigned)cn->requirement);
|
&& (timelimitintics + extratimeintics + secretextratime - player->realtime) >= (unsigned)cn->requirement);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue