mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
Disables opening blast doors & shutters by riding into them (#95102)
## About The Pull Request Swaps the proc being called on doors in the riding component's `vehicle_bump()` proc from `bumpopen()` to `Bumped()`, causing relevant checks to be undergone, most importantly the check for `can_open_with_hands`. Due to the way vehicles are bumped by their drivers and thus cause their drivers' `last_bumped` to be set, the riding component now tracks its own `vehicle_last_bumped` & resets its occupants' `last_bumped` when bumping doors, given the vehicle is off bump cooldown. `vehicle/sealed` gets to keep `bumpopen()` because they give `TRAIT_HANDS_BLOCKED`, but they check for `can_open_with_hands` now. Additionally, just for consistency's sake, firelocks' previous `bumpopen()` override has been removed and replaced with `can_open_with_hands`. ## Why It's Good For The Game fixes #95100 ## Changelog 🆑 fix: Blast doors & shutters no longer inexplicably open when approached on a mount /🆑
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
var/override_allow_spacemove = FALSE
|
||||
/// can anyone other than the rider unbuckle the rider?
|
||||
var/can_force_unbuckle = TRUE
|
||||
/// Like last_bumped for mobs, but for vehicles. Exists to allow the door bump cooldown while also passing door openings through Bumped()
|
||||
var/vehicle_last_bumped = 0
|
||||
|
||||
/**
|
||||
* Ride check flags defined for the specific riding component types, so we know if we need arms, legs, or whatever.
|
||||
@@ -270,10 +272,12 @@
|
||||
/// So we can check all occupants when we bump a door to see if anyone has access
|
||||
/datum/component/riding/proc/vehicle_bump(atom/movable/movable_parent, obj/machinery/door/possible_bumped_door)
|
||||
SIGNAL_HANDLER
|
||||
if(!istype(possible_bumped_door))
|
||||
if(!istype(possible_bumped_door) || world.time - vehicle_last_bumped <= 0.3 SECONDS)
|
||||
return
|
||||
for(var/occupant in movable_parent.buckled_mobs)
|
||||
INVOKE_ASYNC(possible_bumped_door, TYPE_PROC_REF(/obj/machinery/door/, bumpopen), occupant)
|
||||
for(var/mob/living/occupant in movable_parent.buckled_mobs)
|
||||
vehicle_last_bumped = world.time
|
||||
occupant.last_bumped = 0
|
||||
INVOKE_ASYNC(possible_bumped_door, TYPE_PROC_REF(/atom, Bumped), occupant)
|
||||
|
||||
/datum/component/riding/proc/Unbuckle(atom/movable/M)
|
||||
addtimer(CALLBACK(parent, TYPE_PROC_REF(/atom/movable/, unbuckle_mob), M), 0, TIMER_UNIQUE)
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
/// Whether or not the door can crush mobs.
|
||||
var/can_crush = TRUE
|
||||
/// Whether or not the door can be opened by hand (used for blast doors and shutters)
|
||||
/// Whether or not the door can be opened by hand (used for blast doors, shutters & firelocks primarily)
|
||||
var/can_open_with_hands = TRUE
|
||||
/// Whether or not this door can be opened through a door remote, ever
|
||||
var/opens_with_door_remote = FALSE
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
closingLayer = CLOSED_FIREDOOR_LAYER
|
||||
armor_type = /datum/armor/door_firedoor
|
||||
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_REQUIRES_SILICON | INTERACT_MACHINE_OPEN
|
||||
|
||||
can_open_with_hands = FALSE
|
||||
COOLDOWN_DECLARE(activation_cooldown)
|
||||
|
||||
///X offset for the overlay lights, so that they line up with the thin border firelocks
|
||||
@@ -472,9 +472,6 @@
|
||||
return ..()
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/door/firedoor/bumpopen(mob/living/user)
|
||||
return FALSE //No bumping to open, not even in mechs
|
||||
|
||||
/obj/machinery/door/firedoor/proc/on_power_loss()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(istype(A, /obj/machinery/door))
|
||||
var/obj/machinery/door/conditionalwall = A
|
||||
for(var/mob/occupant as anything in return_controllers_with_flag(access_provider_flags))
|
||||
if(conditionalwall.try_safety_unlock(occupant))
|
||||
if(conditionalwall.try_safety_unlock(occupant) || !conditionalwall.can_open_with_hands)
|
||||
return
|
||||
conditionalwall.bumpopen(occupant)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user