Changed the behavior of ObjCanSeeObj_ShootThru_Fix

* now the critter can only see through objects in front of it.
This commit is contained in:
NovaRain
2020-08-08 11:50:12 +08:00
parent 37b4a18770
commit d2b1cdec46
4 changed files with 30 additions and 13 deletions
+1 -1
View File
@@ -577,7 +577,7 @@ InventoryApCost=4
QuickPocketsApCostReduction=2
;Set to 1 to fix obj_can_see_obj script function to allow critters to see through other critters and objects with 'ShootThru' flag set
;Note that enabling this option can cause unexpected NPC behavior in some situations, e.g. able to attack or enter into a dialogue with the player behind some objects
;Note that enabling this option can cause unexpected NPC behavior in some cases, e.g. initiating combat or dialogue when the player is hiding behind some obstacles
ObjCanSeeObj_ShootThru_Fix=0
;Set to 1 to fix the broken obj_can_hear_obj script function
+3 -3
View File
@@ -273,9 +273,9 @@
set_self(0)
// returns the corrected tile distance between two objects to the distance variable (return value >= 9996 is an error when getting the distance)
#define distance_objs(distance, obj1, obj2) distance := tile_distance_objs(obj1, obj2) - 1; \
if (get_flags(obj1) bwand FLAG_MULTIHEX) distance--; \
if (get_flags(obj2) bwand FLAG_MULTIHEX) distance--
#define distance_objs(distance, obj1, obj2) distance := tile_distance_objs(obj1, obj2) - 1; \
if (get_flags(obj1) bwand FLAG_MULTIHEX) then distance--; \
if (get_flags(obj2) bwand FLAG_MULTIHEX) then distance--
/* sfall metalure3 function macros */