mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Jetpack component & Modsuit module signal clean-up & fixes (#76133)
## About The Pull Request 1. Removed the `get_mover` callback, the mover can be retrieved during activation itself 2. Fixes #76116 the user is passed correctly during activation & deactivation same for modsuit modules and this also fixes the same bug for `/obj/item/organ/internal/cyberimp/chest/thrusters` as it's signal was also not registered correctly with the user 3. Timestop module on `on_module_triggered()` accepts user as 2nd param ## Changelog 🆑 fix: jetpack modules work on mod suits again fix: jetpack cyber implants also work refactor: removed `get_mover` callback, user is retrieved during activation refactor: timestop module on `on_module_triggered()` accepts user as 2nd param /🆑
This commit is contained in:
@@ -96,32 +96,38 @@
|
||||
cooldown_time = 0.5 SECONDS
|
||||
overlay_state_inactive = "module_jetpack"
|
||||
overlay_state_active = "module_jetpack_on"
|
||||
/// Do we stop the wearer from gliding in space.
|
||||
var/stabilizers = FALSE
|
||||
/// Do we give the wearer a speed buff.
|
||||
var/full_speed = FALSE
|
||||
var/datum/callback/get_mover
|
||||
var/datum/callback/check_on_move
|
||||
var/stabilize = FALSE
|
||||
var/thrust_callback
|
||||
|
||||
/obj/item/mod/module/jetpack/Initialize(mapload)
|
||||
. = ..()
|
||||
get_mover = CALLBACK(src, PROC_REF(get_user))
|
||||
check_on_move = CALLBACK(src, PROC_REF(allow_thrust))
|
||||
refresh_jetpack()
|
||||
thrust_callback = CALLBACK(src, PROC_REF(allow_thrust))
|
||||
configure_jetpack(stabilize)
|
||||
|
||||
/obj/item/mod/module/jetpack/Destroy()
|
||||
get_mover = null
|
||||
check_on_move = null
|
||||
thrust_callback = null
|
||||
return ..()
|
||||
|
||||
/obj/item/mod/module/jetpack/proc/refresh_jetpack()
|
||||
AddComponent(/datum/component/jetpack, stabilizers, COMSIG_MODULE_TRIGGERED, COMSIG_MODULE_DEACTIVATED, MOD_ABORT_USE, get_mover, check_on_move, /datum/effect_system/trail_follow/ion/grav_allowed)
|
||||
/**
|
||||
* configures/re-configures the jetpack component
|
||||
*
|
||||
* Arguments
|
||||
* stabilize - Should this jetpack be stabalized
|
||||
*/
|
||||
/obj/item/mod/module/jetpack/proc/configure_jetpack(stabilize)
|
||||
src.stabilize = stabilize
|
||||
|
||||
/obj/item/mod/module/jetpack/proc/set_stabilizers(new_stabilizers)
|
||||
if(stabilizers == new_stabilizers)
|
||||
return
|
||||
stabilizers = new_stabilizers
|
||||
refresh_jetpack()
|
||||
AddComponent( \
|
||||
/datum/component/jetpack, \
|
||||
src.stabilize, \
|
||||
COMSIG_MODULE_TRIGGERED, \
|
||||
COMSIG_MODULE_DEACTIVATED, \
|
||||
MOD_ABORT_USE, \
|
||||
thrust_callback, \
|
||||
/datum/effect_system/trail_follow/ion/grav_allowed \
|
||||
)
|
||||
|
||||
/obj/item/mod/module/jetpack/on_activation()
|
||||
. = ..()
|
||||
@@ -137,12 +143,12 @@
|
||||
|
||||
/obj/item/mod/module/jetpack/get_configuration()
|
||||
. = ..()
|
||||
.["stabilizers"] = add_ui_configuration("Stabilizers", "bool", stabilizers)
|
||||
.["stabilizers"] = add_ui_configuration("Stabilizers", "bool", stabilize)
|
||||
|
||||
/obj/item/mod/module/jetpack/configure_edit(key, value)
|
||||
switch(key)
|
||||
if("stabilizers")
|
||||
set_stabilizers(text2num(value))
|
||||
configure_jetpack(text2num(value))
|
||||
|
||||
/obj/item/mod/module/jetpack/proc/allow_thrust(use_fuel = TRUE)
|
||||
if(!use_fuel)
|
||||
@@ -151,9 +157,6 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/mod/module/jetpack/proc/get_user()
|
||||
return mod.wearer
|
||||
|
||||
/obj/item/mod/module/jetpack/advanced
|
||||
name = "MOD advanced ion jetpack module"
|
||||
desc = "An improvement on the previous model of electric thrusters. This one achieves higher speeds through \
|
||||
|
||||
Reference in New Issue
Block a user