diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm index 30d2a47b29b..c7fae967434 100644 --- a/code/modules/lighting/lighting_overlay.dm +++ b/code/modules/lighting/lighting_overlay.dm @@ -146,7 +146,7 @@ SHOULD_CALL_PARENT(FALSE) return -/atom/movable/lighting_overlay/can_fall() +/atom/movable/lighting_overlay/can_fall(anchor_bypass = FALSE, turf/location_override = loc) return FALSE // Override here to prevent things accidentally moving around overlays. diff --git a/code/modules/mechs/mech_movement.dm b/code/modules/mechs/mech_movement.dm index 3c8eeea0d04..b431ce6c770 100644 --- a/code/modules/mechs/mech_movement.dm +++ b/code/modules/mechs/mech_movement.dm @@ -25,9 +25,9 @@ return ..(dir) return ..(ndir) -/mob/living/exosuit/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = src.loc) +/mob/living/exosuit/can_fall(anchor_bypass = FALSE, turf/location_override = loc) //mechs are always anchored, so falling should always ignore it - if(..(TRUE, location_override)) + if((. = ..(TRUE, location_override))) return !(can_overcome_gravity()) //For swimming diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f32c16e2f67..a2da71e4f61 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1174,13 +1174,14 @@ default behaviour is: client.screen += hud_used.hide_actions_toggle /mob/living/handle_fall_effect(var/turf/landing) - ..() - if(istype(landing) && !landing.is_open()) - apply_fall_damage(landing) - if(client) - var/area/A = get_area(landing) - if(A) - A.alert_on_fall(src) + if(!(. = ..()) || !istype(landing)) + return + apply_fall_damage(landing) + if(!client) + return + var/area/landing_area = get_area(landing) + if(landing_area) + landing_area.alert_on_fall(src) /mob/living/proc/apply_fall_damage(var/turf/landing) take_damage(rand(max(1, ceil(mob_size * 0.33)), max(1, ceil(mob_size * 0.66))) * get_fall_height()) diff --git a/code/modules/mob/living/silicon/robot/flying/flying.dm b/code/modules/mob/living/silicon/robot/flying/flying.dm index 42d6b717d93..38147025cfb 100644 --- a/code/modules/mob/living/silicon/robot/flying/flying.dm +++ b/code/modules/mob/living/silicon/robot/flying/flying.dm @@ -46,7 +46,7 @@ /mob/living/silicon/robot/flying/Process_Spacemove() return (pass_flags & PASS_FLAG_TABLE) || ..() -/mob/living/silicon/robot/flying/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = loc) +/mob/living/silicon/robot/flying/can_fall(anchor_bypass = FALSE, turf/location_override = loc) return !Process_Spacemove() /mob/living/silicon/robot/flying/can_overcome_gravity() diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index 71f8a6750c9..e9483712e75 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -111,7 +111,7 @@ moving = FALSE //For children to override -/atom/movable/proc/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = loc) +/atom/movable/proc/can_fall(anchor_bypass = FALSE, turf/location_override = loc) if(immune_to_floor_hazards()) return FALSE @@ -137,16 +137,16 @@ return TRUE -/obj/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = loc) - return ..(anchor_fall) +/obj/can_fall(anchor_bypass = FALSE, turf/location_override = loc) + return ..(anchor_fall, location_override) -/obj/effect/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = loc) +/obj/effect/can_fall(anchor_bypass = FALSE, turf/location_override = loc) return FALSE -/obj/effect/decal/cleanable/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = loc) +/obj/effect/decal/cleanable/can_fall(anchor_bypass = FALSE, turf/location_override = loc) return TRUE -/obj/item/pipe/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = loc) +/obj/item/pipe/can_fall(anchor_bypass = FALSE, turf/location_override = loc) var/turf/open/below = loc below = below.below @@ -158,18 +158,21 @@ if((locate(/obj/structure/disposalpipe/up) in below) || locate(/obj/machinery/atmospherics/pipe/zpipe/up) in below) return FALSE -/mob/living/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = loc) +/mob/living/can_fall(anchor_bypass = FALSE, turf/location_override = loc) if((. = ..())) var/decl/species/my_species = get_species() if(my_species) return my_species.can_fall(src) /atom/movable/proc/protected_from_fall_damage(var/turf/landing) - if(!!(locate(/obj/structure/stairs) in landing)) - return TRUE - var/turf/wall/natural/ramp = landing - if(istype(ramp) && ramp.ramp_slope_direction) // walking down a ramp - return TRUE + // Stairs and ramps will not save you from a high drop. + if(get_fall_height() <= 1) + if(!!(locate(/obj/structure/stairs) in landing)) + return TRUE + var/turf/wall/natural/ramp = landing + if(istype(ramp) && ramp.ramp_slope_direction) // walking down a ramp + return TRUE + return FALSE /mob/protected_from_fall_damage(var/turf/landing) . = ..() @@ -213,10 +216,16 @@ /atom/movable/proc/handle_fall_effect(var/turf/landing) SHOULD_CALL_PARENT(TRUE) - if(istype(landing) && landing.is_open()) - visible_message("\The [src] falls through \the [landing]!", "You hear a whoosh of displaced air.") + if(istype(landing) && can_fall() && landing.CanZPass(src, DOWN)) + visible_message( + SPAN_NOTICE("\The [src] falls through \the [landing]!"), + "You hear a whoosh of displaced air." + ) else - visible_message("\The [src] slams into \the [landing]!", "You hear something slam into the [global.using_map.ground_noun].") + visible_message( + SPAN_DANGER("\The [src] slams into [landing.is_open() ? "\the [landing]" : "an obstacle"]!"), + "You hear something slam into the [global.using_map.ground_noun]." + ) var/fall_damage = fall_damage() * get_fall_height() if(fall_damage > 0) for(var/mob/living/M in landing.contents) @@ -421,7 +430,7 @@ owner = null . = ..() -/atom/movable/z_observer/can_fall() +/atom/movable/z_observer/can_fall(anchor_bypass = FALSE, turf/location_override = loc) return FALSE /atom/movable/z_observer/explosion_act() diff --git a/code/modules/multiz/zmimic/mimic_movable.dm b/code/modules/multiz/zmimic/mimic_movable.dm index 04644bcdde7..2cbf1c065f4 100644 --- a/code/modules/multiz/zmimic/mimic_movable.dm +++ b/code/modules/multiz/zmimic/mimic_movable.dm @@ -49,7 +49,7 @@ mouse_opacity = FALSE abstract_type = /atom/movable/openspace // unsure if this is valid, check with Lohi -- Yes, it's valid. -/atom/movable/openspace/can_fall() +/atom/movable/openspace/can_fall(anchor_bypass = FALSE, turf/location_override = loc) return FALSE // No blowing up abstract objects.