From bb6e8aa19c6f78127d69cc0a092c278993a6263a Mon Sep 17 00:00:00 2001 From: wts42 <36044012+wts42@users.noreply.github.com> Date: Sun, 1 Apr 2018 21:03:52 +0200 Subject: [PATCH] Change memory.read_s16_le(0x1497) to memory.readbyte(0x1497) In functions **_M.getMarioHit(alreadyHit)** and **_M.getMarioHitTimer()** change **memory.read_s16_le(0x1497)** to **memory.readbyte(0x1497)**. Prevents script to detect false hits, for example when picking up a koopatroopa shell. --- neat-mario/game.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neat-mario/game.lua b/neat-mario/game.lua index 8022992..e7e37c8 100644 --- a/neat-mario/game.lua +++ b/neat-mario/game.lua @@ -26,7 +26,7 @@ function _M.getScore() end function _M.getMarioHit(alreadyHit) - local timer = memory.read_s16_le(0x1497) + local timer = memory.readbyte(0x1497) if timer > 0 then if alreadyHit == false then return true @@ -39,7 +39,7 @@ function _M.getMarioHit(alreadyHit) end function _M.getMarioHitTimer() - local timer = memory.read_s16_le(0x1497) + local timer = memory.readbyte(0x1497) return timer end @@ -149,4 +149,4 @@ function _M.clearJoypad() joypad.set(controller) end -return _M \ No newline at end of file +return _M