Ensure wild battle completes before marking the current trainer as fought

This commit is contained in:
Kyle Coburn 2015-04-23 00:09:05 -07:00
parent 2bc81fbfb7
commit 647ab341e1
1 changed files with 7 additions and 6 deletions

View File

@ -185,13 +185,14 @@ function Strategies.damaged(factor)
end
function Strategies.trainerBattle()
if Battle.isActive() then
if not status.foughtTrainer then
if Battle.handleWild() then
status.foughtTrainer = true
end
local battleStatus = Memory.value("game", "battle")
if battleStatus > 0 then
if battleStatus == 2 then
Strategies.initialize("foughtTrainer")
return true
end
return true
Battle.handleWild(battleStatus)
return false
end
Textbox.handle()
end