mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 16:47:13 +01:00
Makes check_teleport_valid pure & signal clean up (#90738)
- Closes #90704 The following changes were implemented for this - Moved sending signals `COMSIG_MOVABLE_TELEPORTING` & `COMSIG_ATOM_INTERCEPT_TELEPORTING` from `check_teleport_valid` into `do_teleport`. These 2 signals were causing all the side effects - Removed signals `COMSIG_ATOM_INTERCEPT_TELEPORTED` & `COMSIG_MOVABLE_TELEPORTED` as the above 2 signals can do their jobs & block the teleport if needed so these signals became obsolete - Removed define `COMPONENT_BLOCK_TELEPORT` in favour of returning a positive value if teleport was successfully blocked. Having 2 signals located in 2 separate files use this same define doesn't look great. 🆑 code: cleans up teleportation code. `check_teleport_valid` is now a pure function with no side effects /🆑
This commit is contained in:
@@ -105,12 +105,12 @@
|
||||
COMSIG_LIVING_GET_PULLED,
|
||||
), PROC_REF(stop_leaning))
|
||||
|
||||
RegisterSignal(src, COMSIG_MOVABLE_TELEPORTED, PROC_REF(teleport_away_while_leaning))
|
||||
RegisterSignal(src, COMSIG_MOVABLE_POST_TELEPORT, PROC_REF(teleported_away_while_leaning))
|
||||
// RegisterSignal(src, COMSIG_ATOM_POST_DIR_CHANGE, PROC_REF(lean_dir_changed)) // BUBBER EDIT REMOVE - Don't reset leaning on direction change
|
||||
update_fov()
|
||||
|
||||
/// You fall on your face if you get teleported while leaning
|
||||
/mob/living/proc/teleport_away_while_leaning()
|
||||
/mob/living/proc/teleported_away_while_leaning()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
// Make sure we unregister signal handlers and reset animation
|
||||
@@ -127,7 +127,7 @@
|
||||
COMSIG_LIVING_DISARM_HIT,
|
||||
COMSIG_LIVING_GET_PULLED,
|
||||
COMSIG_ATOM_POST_DIR_CHANGE,
|
||||
COMSIG_MOVABLE_TELEPORTED,
|
||||
COMSIG_MOVABLE_POST_TELEPORT,
|
||||
))
|
||||
remove_offsets(LEANING_TRAIT)
|
||||
remove_traits(list(TRAIT_UNDENSE, TRAIT_EXPANDED_FOV), LEANING_TRAIT)
|
||||
|
||||
Reference in New Issue
Block a user