Fix invuln cheat on Solar and terrain.
Some checks are pending
GenerateBuilds / generate-port-o2r (push) Waiting to run
GenerateBuilds / build-windows (push) Blocked by required conditions
GenerateBuilds / build-macos (push) Blocked by required conditions
GenerateBuilds / build-linux (push) Blocked by required conditions

This commit is contained in:
Jed 2025-02-02 19:19:14 -08:00 committed by Lywx
parent 6a52c9a2ae
commit fb130d48ba

View File

@ -974,6 +974,10 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) {
Vec3f sp38;
f32 sp34 = 20.0f;
if (CVarGetInteger("gInvincible", 0)) {
damage = 0;
}
player->dmgType = damage;
player->hitDirection = direction;
@ -6945,7 +6949,9 @@ void Play_UpdateLevel(void) {
}
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && ((gGameFrameCount & cycleMask) == 0)) {
gPlayer[0].shields--;
if (!CVarGetInteger("gInvincible", 0)) {
gPlayer[0].shields--;
}
if (gPlayer[0].shields <= 0) {
gPlayer[0].shields = 0;
}