mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Self-review: TrackHazard
- Fix the highest bit handling - Cleaner code for specific lap handling
This commit is contained in:
parent
340ac0de0f
commit
94cfda6832
1 changed files with 2 additions and 2 deletions
|
|
@ -1737,7 +1737,7 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
||||||
|
|
||||||
// Check the highest relevant byte for all necessary bits.
|
// Check the highest relevant byte for all necessary bits.
|
||||||
// We only do this if an == 0xFF/0xFE check wouldn't satisfy.
|
// We only do this if an == 0xFF/0xFE check wouldn't satisfy.
|
||||||
if (requiredbit != 7)
|
if (requiredbit != (1<<7))
|
||||||
{
|
{
|
||||||
// Last bit MAYBE not needed, POSITION doesn't count.
|
// Last bit MAYBE not needed, POSITION doesn't count.
|
||||||
const UINT8 finalbit = (requiredlap == 0) ? 1 : 0;
|
const UINT8 finalbit = (requiredlap == 0) ? 1 : 0;
|
||||||
|
|
@ -1765,7 +1765,7 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
||||||
return (player->roundconditions.hittrackhazard[0] == 0xFE);
|
return (player->roundconditions.hittrackhazard[0] == 0xFE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (!(player->roundconditions.hittrackhazard[requiredlap] & requiredbit) != (cn->requirement == 1));
|
return (((player->roundconditions.hittrackhazard[requiredlap] & requiredbit) == requiredbit) == (cn->requirement == 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
case UCRP_TARGETATTACKMETHOD:
|
case UCRP_TARGETATTACKMETHOD:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue