From 72e713b0239710c1b515c8b1d01b2cb6de9b880c Mon Sep 17 00:00:00 2001 From: Miepee Date: Mon, 2 Oct 2023 21:56:53 +0200 Subject: [PATCH] Fix negative flashlights --- YAMS-LIB/Program.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/YAMS-LIB/Program.cs b/YAMS-LIB/Program.cs index 3c94ed5..c1239fc 100644 --- a/YAMS-LIB/Program.cs +++ b/YAMS-LIB/Program.cs @@ -2147,11 +2147,14 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te // Flashlight PrependGMLInCode(characterVarsCode, "global.flashlightLevel = 0;"); - PrependGMLInCode(gmData.Code.ByName("gml_Script_ApplyLightPreset"), """ - global.darkness -= global.flashlightLevel - if (global.darkness < 0) - global.darkness = 0 - """); + PrependGMLInCode(gmData.Code.ByName("gml_Script_ApplyLightPreset"), +""" + global.darkness -= global.flashlightLevel + if (global.darkness < 0) + global.darkness = 0 + if (global.darkness > 4) + global.darkness = 4 + """); // Set starting items bool alreadyAddedMissiles = false;