From 52e920e874633d2ae36d6eefe85007b93bc0e7c4 Mon Sep 17 00:00:00 2001 From: SteelT Date: Sat, 16 Sep 2023 14:58:53 -0400 Subject: [PATCH] Sealed Stars: fix UFODebugSetHealth always running Resolves #686 --- src/cvars.cpp | 2 +- src/objects/ufo.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cvars.cpp b/src/cvars.cpp index bcfedba5c..4fd79c158 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -803,7 +803,7 @@ consvar_t cv_restrictskinchange = OnlineCheat("restrictskinchange", "Yes").yes_n consvar_t cv_spbtest = OnlineCheat("spbtest", "Off").on_off().description("SPB can never target a player"); consvar_t cv_timescale = OnlineCheat(cvlist_timer)("timescale", "1.0").floating_point().min_max(FRACUNIT/20, 20*FRACUNIT).description("Overclock or slow down the game"); consvar_t cv_ufo_follow = OnlineCheat("ufo_follow", "0").min_max(0, MAXPLAYERS).description("Make UFO Catcher folow this player"); -consvar_t cv_ufo_health = OnlineCheat("ufo_health", "100").min_max(0, 100).description("Override UFO Catcher health -- applied at spawn or when value is changed"); +consvar_t cv_ufo_health = OnlineCheat("ufo_health", "-1").min_max(-1, 100).description("Override UFO Catcher health -- applied at spawn or when value is changed"); // diff --git a/src/objects/ufo.c b/src/objects/ufo.c index e9b983ac0..f9c9809d6 100644 --- a/src/objects/ufo.c +++ b/src/objects/ufo.c @@ -295,7 +295,7 @@ static void UFOUpdateSpeed(mobj_t *ufo) SpawnEmeraldSpeedLines(ufo); } else if (ufo_speed(ufo) > 70*FRACUNIT && !S_SoundPlaying(ufo, sfx_clawzm)) - { + { S_StartSound(ufo, sfx_clawzm); } } @@ -580,7 +580,10 @@ void Obj_SpecialUFOThinker(mobj_t *ufo) { { extern consvar_t cv_ufo_health; - UFODebugSetHealth(ufo, cv_ufo_health.value); + if (cv_ufo_health.value != -1) + { + UFODebugSetHealth(ufo, cv_ufo_health.value); + } } UFOMove(ufo); @@ -700,7 +703,7 @@ static void UFOCopyHitlagToPieces(mobj_t *ufo) { spawn_debris (piece); } - + piece = ufo_piece_next(piece); } }