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.
This commit is contained in:
wts42 2018-04-01 21:03:52 +02:00 committed by GitHub
parent 78b0cab1b4
commit bb6e8aa19c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ function _M.getScore()
end end
function _M.getMarioHit(alreadyHit) function _M.getMarioHit(alreadyHit)
local timer = memory.read_s16_le(0x1497) local timer = memory.readbyte(0x1497)
if timer > 0 then if timer > 0 then
if alreadyHit == false then if alreadyHit == false then
return true return true
@ -39,7 +39,7 @@ function _M.getMarioHit(alreadyHit)
end end
function _M.getMarioHitTimer() function _M.getMarioHitTimer()
local timer = memory.read_s16_le(0x1497) local timer = memory.readbyte(0x1497)
return timer return timer
end end
@ -149,4 +149,4 @@ function _M.clearJoypad()
joypad.set(controller) joypad.set(controller)
end end
return _M return _M