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:
parent
78b0cab1b4
commit
bb6e8aa19c
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue