Skip to content
Snippets Groups Projects
Commit 23b15dfa authored by Alex Ksandra's avatar Alex Ksandra
Browse files

"Object seen" markings is now reasonably per-actor... except for main player.

parent ae8b84b8
No related branches found
No related tags found
1 merge request!150Quality fixes
......@@ -1054,6 +1054,7 @@ end
-- '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 is_main_player = self == game:getPlayer(true)
local spotted = spotHostiles(self)
if #spotted > 0 then
......@@ -1069,10 +1070,11 @@ function _M:runCheck(ignore_memory)
local noticed = false
self:runScan(function(x, y, what)
-- Objects are always interesting, only on curent spot
if what == "self" and not game.level.map.attrs(x, y, "obj_seen") then
local obj_seen = game.level.map.attrs(x, y, "obj_seen")
if what == "self" and obj_seen ~= self and obj_self ~= true then
local obj = game.level.map:getObject(x, y, 1)
if obj then
if not ignore_memory then game.level.map.attrs(x, y, "obj_seen", true) end
if not ignore_memory then game.level.map.attrs(x, y, "obj_seen", is_main_player and true or self) end
noticed = "object seen"
return false, noticed
end
......@@ -1518,3 +1520,5 @@ function _M:attackOrMoveDir(dir)
self:moveDir(dir)
game_or_player.bump_attack_disabled = tmp
end
return _M
\ No newline at end of file
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