From f4c54655f2081346705e1724506be29e01cb3616 Mon Sep 17 00:00:00 2001 From: cracyc Date: Mon, 24 Jul 2017 16:17:43 -0500 Subject: [PATCH] plugins/cheat: make sure bp function is run only one per hit (nw) --- plugins/cheat/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index 6901986b92b..dd4186cf1be 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -81,6 +81,7 @@ function cheat.startplugin() local stop = true local cheatname = "" local consolelog = nil + local consolelast = 0 local watches = {} local breaks = {} @@ -255,7 +256,7 @@ function cheat.startplugin() local function periodiccb() local msg = consolelog[#consolelog] - if msg:find("Stopped at", 1, true) then + if #consolelog > consolelast and msg:find("Stopped at", 1, true) then local point = msg:match("Stopped at breakpoint ([0-9]+)") if not point then point = msg:match("Stopped at watchpoint ([0-9]+") @@ -277,6 +278,7 @@ function cheat.startplugin() manager:machine():debugger().execution_state = "run" end end + consolelast = #consolelog end local function bpset(cheat, dev, addr, func) @@ -693,6 +695,7 @@ function cheat.startplugin() load_hotkeys() if manager:machine():debugger() then consolelog = manager:machine():debugger().consolelog + consolelast = 0 end end)