mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Forbid character-based unlocks if you switched your skin in a context where it didn't auto-spectate you (more robust stop for #1231)
This commit is contained in:
parent
4f37a3f183
commit
b818a7d776
3 changed files with 35 additions and 21 deletions
|
|
@ -1203,11 +1203,17 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
// The following is a miniature subset of Got_Teamchange.
|
// The following is a miniature subset of Got_Teamchange.
|
||||||
if ((gamestate == GS_LEVEL) // In a level?
|
if ((gamestate == GS_LEVEL) // In a level?
|
||||||
&& (cv_restrictskinchange.value) // Skin changes are restricted?
|
|
||||||
&& (G_GametypeHasSpectators() && players[playernum].spectator == false) // not a spectator but could be?
|
|
||||||
&& (players[playernum].jointime > 1) // permit on join
|
&& (players[playernum].jointime > 1) // permit on join
|
||||||
&& (leveltime > introtime) // permit during intro turnaround
|
&& (leveltime > introtime) // permit during intro turnaround
|
||||||
&& (players[playernum].skin != oldskin)) // a skin change actually happened?
|
&& (players[playernum].skin != oldskin)) // a skin change actually happened?
|
||||||
|
{
|
||||||
|
players[playernum].roundconditions.switched_skin = true;
|
||||||
|
|
||||||
|
if (
|
||||||
|
cv_restrictskinchange.value // Skin changes are restricted?
|
||||||
|
&& G_GametypeHasSpectators() // not a spectator...
|
||||||
|
&& players[playernum].spectator == false // ...but could be?
|
||||||
|
)
|
||||||
{
|
{
|
||||||
for (i = 0; i < MAXPLAYERS; ++i)
|
for (i = 0; i < MAXPLAYERS; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -1234,6 +1240,7 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// set follower colour:
|
// set follower colour:
|
||||||
// Don't bother doing garbage and kicking if we receive None,
|
// Don't bother doing garbage and kicking if we receive None,
|
||||||
|
|
|
||||||
|
|
@ -464,6 +464,9 @@ struct roundconditions_t
|
||||||
|
|
||||||
// 32 triggers, one bit each, for map execution
|
// 32 triggers, one bit each, for map execution
|
||||||
UINT32 unlocktriggers;
|
UINT32 unlocktriggers;
|
||||||
|
|
||||||
|
// Forbidding skin-based unlocks if you changed your skin
|
||||||
|
boolean switched_skin;
|
||||||
};
|
};
|
||||||
|
|
||||||
// player_t struct for all skybox variables
|
// player_t struct for all skybox variables
|
||||||
|
|
|
||||||
|
|
@ -1649,9 +1649,13 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
||||||
case UCRP_ISMAP:
|
case UCRP_ISMAP:
|
||||||
return (gamemap == cn->requirement+1);
|
return (gamemap == cn->requirement+1);
|
||||||
case UCRP_ISCHARACTER:
|
case UCRP_ISCHARACTER:
|
||||||
return (player->skin == cn->requirement);
|
return (
|
||||||
|
player->roundconditions.switched_skin == false
|
||||||
|
&& player->skin == cn->requirement
|
||||||
|
);
|
||||||
case UCRP_ISENGINECLASS:
|
case UCRP_ISENGINECLASS:
|
||||||
return (player->skin < numskins
|
return (player->roundconditions.switched_skin == false
|
||||||
|
&& player->skin < numskins
|
||||||
&& R_GetEngineClass(
|
&& R_GetEngineClass(
|
||||||
skins[player->skin].kartspeed,
|
skins[player->skin].kartspeed,
|
||||||
skins[player->skin].kartweight,
|
skins[player->skin].kartweight,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue