mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +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)
|
||||
|
||||
Reference in New Issue
Block a user