From a31f51245c867bd9956da610cdb347f90dad0579 Mon Sep 17 00:00:00 2001 From: Blake Warner Date: Tue, 5 Apr 2022 19:51:23 -0400 Subject: [PATCH] implemented invincibility cheat --- src/code/z_parameter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/code/z_parameter.cpp b/src/code/z_parameter.cpp index 3b7256748..0f7f16f90 100644 --- a/src/code/z_parameter.cpp +++ b/src/code/z_parameter.cpp @@ -15,6 +15,7 @@ #include "z_parameter.h" #include "kaleido_macros.h" #include "gfx_align.h" +#include "port/options.h" #include "textures/parameter_static/parameter_static.h" #include "textures/do_action_static/do_action_static.h" @@ -2819,7 +2820,10 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) } // clang-format on - gSaveContext.health += healthChange; + if(!oot::config().cheats().invincible() || healthChange > 0) + { + gSaveContext.health += healthChange; + } if(gSaveContext.health > gSaveContext.healthCapacity) {