Skip to content
Snippets Groups Projects
Commit 89488764 authored by dg's avatar dg
Browse files

Running and resting are stopped when a dialog pops up

git-svn-id: http://svn.net-core.org/repos/t-engine4@6607 51575b47-30f0-44d4-a5cc-537603b46e54
parent daa51faf
No related branches found
No related tags found
No related merge requests found
......@@ -339,8 +339,9 @@ function _M:unregisterDialog(d)
end
--- Do we have a dialog running
function _M:hasDialogUp()
return #self.dialogs > 0
function _M:hasDialogUp(nb)
nb = nb or 0
return #self.dialogs > nb
end
--- The C core gives us command line arguments
......
......@@ -737,6 +737,8 @@ end
--- Can we continue resting ?
-- We can rest if no hostiles are in sight, and if we need life/mana/stamina/psi (and their regen rates allows them to fully regen)
function _M:restCheck()
if game:hasDialogUp(1) then return false, "dialog is displayed" end
local spotted = spotHostiles(self)
if #spotted > 0 then
for _, node in ipairs(spotted) do
......@@ -824,6 +826,8 @@ end
-- Known traps aren't interesting. We let the engine run around traps, or stop if it can't.
-- 'ignore_memory' is only used when checking for paths around traps. This ensures we don't remember items "obj_seen" that we aren't supposed to
function _M:runCheck(ignore_memory)
if game:hasDialogUp(1) then return false, "dialog is displayed" end
local spotted = spotHostiles(self)
if #spotted > 0 then
local dir = game.level.map:compassDirection(spotted[1].x - self.x, spotted[1].y - self.y)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment