Merge pull request #1046 from Citadel-Station-13/upstream-merge-27292
[MIRROR] Fixes clicking things under windows/doors.
This commit is contained in:
@@ -27,6 +27,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
#define BLOCK_GAS_SMOKE_EFFECT 4096 // blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
|
||||
#define THICKMATERIAL 8192 //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body.
|
||||
#define DROPDEL 16384 // When dropped, it calls qdel on itself
|
||||
#define PREVENT_CLICK_UNDER 32768 //Prevent clicking things below it on the same turf eg. doors/ fulltile windows
|
||||
|
||||
/* Secondary atom flags, access using the SECONDARY_FLAG macros */
|
||||
|
||||
|
||||
@@ -92,6 +92,9 @@
|
||||
if(next_move > world.time) // in the year 2000...
|
||||
return
|
||||
|
||||
if(A.IsObscured())
|
||||
return
|
||||
|
||||
if(istype(loc,/obj/mecha))
|
||||
var/obj/mecha/M = loc
|
||||
return M.click_action(A,src,params)
|
||||
@@ -141,6 +144,22 @@
|
||||
else
|
||||
RangedAttack(A,params)
|
||||
|
||||
//Is the atom obscured by a PREVENT_CLICK_UNDER object above it
|
||||
/atom/proc/IsObscured()
|
||||
if(!isturf(loc)) //This only makes sense for things directly on turfs for now
|
||||
return FALSE
|
||||
var/turf/T = loc
|
||||
for(var/atom/movable/AM in T)
|
||||
if(AM.flags & PREVENT_CLICK_UNDER && AM.density && AM.layer > layer)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/turf/IsObscured()
|
||||
for(var/atom/movable/AM in src)
|
||||
if(AM.flags & PREVENT_CLICK_UNDER && AM.density)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/CanReach(atom/target,obj/item/tool,view_only = FALSE)
|
||||
if(isturf(target) || isturf(target.loc) || DirectAccess(target)) //Directly accessible atoms
|
||||
if(Adjacent(target) || (tool && CheckToolReach(src, target, tool.reach))) //Adjacent or reaching attacks
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
max_integrity = 350
|
||||
armor = list(melee = 30, bullet = 30, laser = 20, energy = 20, bomb = 10, bio = 100, rad = 100, fire = 80, acid = 70)
|
||||
CanAtmosPass = ATMOS_PASS_DENSITY
|
||||
flags = PREVENT_CLICK_UNDER
|
||||
|
||||
var/secondsElectrified = 0
|
||||
var/shockedby = list()
|
||||
|
||||
@@ -440,7 +440,7 @@
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
max_integrity = 50
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
flags = PREVENT_CLICK_UNDER
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile,/obj/structure/window/reinforced/highpressure/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
|
||||
glass_amount = 2
|
||||
@@ -454,7 +454,7 @@
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
max_integrity = 100
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
flags = PREVENT_CLICK_UNDER
|
||||
smooth = SMOOTH_TRUE
|
||||
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile,/obj/structure/window/reinforced/highpressure/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
|
||||
@@ -467,7 +467,7 @@
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
max_integrity = 1000
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
flags = PREVENT_CLICK_UNDER
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile,/obj/structure/window/reinforced/highpressure/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
|
||||
level = 3
|
||||
@@ -481,7 +481,7 @@
|
||||
icon_state = "tinted_window"
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
flags = PREVENT_CLICK_UNDER
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile,/obj/structure/window/reinforced/highpressure/fulltile, /obj/structure/window/reinforced/tinted/fulltile/)
|
||||
level = 3
|
||||
@@ -504,7 +504,7 @@
|
||||
max_integrity = 100
|
||||
wtype = "shuttle"
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
flags = PREVENT_CLICK_UNDER
|
||||
reinf = 1
|
||||
heat_resistance = 1600
|
||||
armor = list(melee = 50, bullet = 0, laser = 0, energy = 0, bomb = 25, bio = 100, rad = 100, fire = 80, acid = 100)
|
||||
@@ -583,7 +583,7 @@
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = null
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
flags = PREVENT_CLICK_UNDER
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
max_integrity = 120
|
||||
level = 3
|
||||
|
||||
Reference in New Issue
Block a user