Skip to content

Commit

Permalink
check condition on npc
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Gatto <uso.cosmo.ray@gmail.com>
  • Loading branch information
cosmo-ray committed Oct 29, 2023
1 parent 2ef365d commit 3149d35
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions phq.lua
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ function checkNpcPresence(obj, npc, scene, is_ai_point)
if pp > 0 and yuiRand() % 99 > pp then
return false
end
if yIsNNil(yeGet(obj, "Chapter")) and yeGetIntAt(obj, "Chapter") ~= yeGetInt(phq.env.chapter) then
if yIsNNil(yeGet(obj, "Chapter")) and
yeGetIntAt(obj, "Chapter") ~= yeGetInt(phq.env.chapter) then
return false
end
if yeGetIntAt(obj, "dead") == 1 then
Expand All @@ -283,7 +284,7 @@ function checkNpcPresence(obj, npc, scene, is_ai_point)
is_ai_point == false and
yeGetInt(npc.out_time.day) == phq.env.day:to_int() and
yeGetInt(npc.out_time.week) == phq.env.week:to_int() and
yeGetString(npc.out_time.time) == phq.env.time:to_string() then
yeGetString(npc.out_time.time) == phq.env.time:to_string() then
return false
end

Expand Down Expand Up @@ -312,7 +313,7 @@ function checkNpcPresence(obj, npc, scene, is_ai_point)
return false
end
end
return true
return checkTiledCondition(Entity.wrapp(obj))
end

local function _include(target, file)
Expand Down

0 comments on commit 3149d35

Please sign in to comment.