mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
[MIRROR] Fixes stowing suit storage jetpacks when retracting modsuit chestplates [MDB IGNORE] (#21888)
* Fixes stowing suit storage jetpacks when retracting modsuit chestplates (#75844) ## About The Pull Request This is a bizare bug I discovered while trying to develop another feature, so let's just get into the reproduction steps: - Wear a modsuit and extend it's parts - Put a jetpack in the suit storage slot and turn it on. Currently, the only jetpack that fits in the storage slot on TG is the captain's jetpack. - While the jetpack is activated, deactivate your modsuit using the UI, which stows the jetpack into your storage module automatically. - This fails to unregister some signal thing because it can't find the user. My fix *could* be shitcode, so any feedback would be appreciated. Jetpack activation and deactivation signals now pass a user. `/datum/component/jetpack/proc/activate(datum/source, mob/user)` `/datum/component/jetpack/proc/deactivate(datum/source, mob/user)` Some jetpack `pre_move_react` thing now has a check to see if it's argument is null. ``` if(!trail) return FALSE ``` ## Why It's Good For The Game Stops a crash/runtime. ## Changelog 🆑 stonetear fix: jetpack signals now pass a user argument. This fixes an error when automatically stowing a captain jetpack into your modsuit. /🆑 * Fixes stowing suit storage jetpacks when retracting modsuit chestplates --------- Co-authored-by: Stonetear <89315023+Stonetear@users.noreply.github.com>
This commit is contained in:
@@ -78,27 +78,25 @@
|
||||
trail.auto_process = FALSE
|
||||
trail.set_up(moving)
|
||||
|
||||
/datum/component/jetpack/proc/activate(datum/source)
|
||||
/datum/component/jetpack/proc/activate(datum/source, mob/user)
|
||||
SIGNAL_HANDLER
|
||||
var/mob/moving = get_mover.Invoke()
|
||||
if(!thrust(moving))
|
||||
if(!thrust(user))
|
||||
return return_flag
|
||||
trail.start()
|
||||
RegisterSignal(moving, COMSIG_MOVABLE_MOVED, PROC_REF(move_react))
|
||||
RegisterSignal(moving, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(pre_move_react))
|
||||
RegisterSignal(moving, COMSIG_MOVABLE_SPACEMOVE, PROC_REF(spacemove_react))
|
||||
RegisterSignal(moving, COMSIG_MOVABLE_DRIFT_VISUAL_ATTEMPT, PROC_REF(block_starting_visuals))
|
||||
RegisterSignal(moving, COMSIG_MOVABLE_DRIFT_BLOCK_INPUT, PROC_REF(ignore_ending_block))
|
||||
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(move_react))
|
||||
RegisterSignal(user, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(pre_move_react))
|
||||
RegisterSignal(user, COMSIG_MOVABLE_SPACEMOVE, PROC_REF(spacemove_react))
|
||||
RegisterSignal(user, COMSIG_MOVABLE_DRIFT_VISUAL_ATTEMPT, PROC_REF(block_starting_visuals))
|
||||
RegisterSignal(user, COMSIG_MOVABLE_DRIFT_BLOCK_INPUT, PROC_REF(ignore_ending_block))
|
||||
|
||||
/datum/component/jetpack/proc/deactivate(datum/source)
|
||||
/datum/component/jetpack/proc/deactivate(datum/source, mob/user)
|
||||
SIGNAL_HANDLER
|
||||
var/mob/moving = get_mover.Invoke()
|
||||
if(moving)
|
||||
UnregisterSignal(moving, COMSIG_MOVABLE_MOVED)
|
||||
UnregisterSignal(moving, COMSIG_MOVABLE_PRE_MOVE)
|
||||
UnregisterSignal(moving, COMSIG_MOVABLE_SPACEMOVE)
|
||||
UnregisterSignal(moving, COMSIG_MOVABLE_DRIFT_VISUAL_ATTEMPT)
|
||||
UnregisterSignal(moving, COMSIG_MOVABLE_DRIFT_BLOCK_INPUT)
|
||||
if(user)
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_PRE_MOVE)
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_SPACEMOVE)
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_DRIFT_VISUAL_ATTEMPT)
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_DRIFT_BLOCK_INPUT)
|
||||
QDEL_NULL(trail) //delete AFTER unregistering the mob, otherwise you'll get runtimes.
|
||||
|
||||
/datum/component/jetpack/proc/move_react(mob/user)
|
||||
@@ -118,6 +116,8 @@
|
||||
|
||||
/datum/component/jetpack/proc/pre_move_react(mob/user)
|
||||
SIGNAL_HANDLER
|
||||
if(!trail)
|
||||
return FALSE
|
||||
trail.oldposition = get_turf(user)
|
||||
|
||||
/datum/component/jetpack/proc/spacemove_react(mob/user, movement_dir, continuous_move)
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
icon_state = "[initial(icon_state)][on ? "-on" : ""]"
|
||||
|
||||
/obj/item/tank/jetpack/proc/turn_on(mob/user)
|
||||
if(SEND_SIGNAL(src, COMSIG_JETPACK_ACTIVATED) & JETPACK_ACTIVATION_FAILED)
|
||||
if(SEND_SIGNAL(src, COMSIG_JETPACK_ACTIVATED, user) & JETPACK_ACTIVATION_FAILED)
|
||||
return FALSE
|
||||
on = TRUE
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
@@ -95,7 +95,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/item/tank/jetpack/proc/turn_off(mob/user)
|
||||
SEND_SIGNAL(src, COMSIG_JETPACK_DEACTIVATED)
|
||||
SEND_SIGNAL(src, COMSIG_JETPACK_DEACTIVATED, user)
|
||||
on = FALSE
|
||||
set_stabilizers(FALSE)
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
Reference in New Issue
Block a user