From 150e3098dee0b8e72238436f25c37b14c83410aa Mon Sep 17 00:00:00 2001 From: mekolat Date: Tue, 18 Aug 2015 16:28:57 -0400 Subject: replicate magic-v2's line_of_sight --- src/map/script-fun.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 51039ad..0c6ebb8 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -601,7 +601,7 @@ void builtin_target(ScriptState *st) val |= 0x04; // 0x04 target is walkable (has clear path to target) } - // TODO 0x08 target is visible (not behind collision) XXX maybe this is line of sight? + // TODO 0x08 target is visible (not behind collision) if (flag & 0x10) { @@ -610,7 +610,11 @@ void builtin_target(ScriptState *st) val |= 0x10; // 0x10 target can be attacked by source (killer, killable and so on) } - // TODO 0x20 target is in line of sight + if (flag & 0x20) + { + if (battle_check_range(source, target, 0)) + val |= 0x20; // 0x20 target is in line of sight + } push_int(st->stack, val); } -- cgit v1.2.3-70-g09d2