mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
[MIRROR] Fixes funky magic item teleportation [MDB IGNORE] (#10865)
* Fixes funky magic item teleportation (#64263) Space drifting "listened" for moves outside of its expected range, and if it saw them it would self delete The problem is it registered for this behavior in drifting_start(), which was intended to be called by the MOVELOOP_START signal But because that signal was fired as a consequence of move() being called, we never registered the signal So if you took an item out of your pack, when it hit the ground it would get the drifting component Next tick it would be drift moved to its intended location, the move would "fail", and then it would stop This lead to items being visually in your inventory, but not functionally Which leads to a lot of really weird behavior Oh and I added a var to moveloops that's just "are we running" to make solving this class of issue easier * Fixes funky magic item teleportation Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
co-authored by
LemonInTheDark
parent
876cfcd8f0
commit
015020189b
@@ -18,13 +18,13 @@
|
||||
if(!drifting_loop) //Really want to qdel here but can't
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
RegisterSignal(movable_parent, COMSIG_MOVABLE_NEWTONIAN_MOVE, .proc/newtonian_impulse)
|
||||
|
||||
RegisterSignal(drifting_loop, COMSIG_MOVELOOP_START, .proc/drifting_start)
|
||||
RegisterSignal(drifting_loop, COMSIG_MOVELOOP_STOP, .proc/drifting_stop)
|
||||
RegisterSignal(drifting_loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, .proc/before_move)
|
||||
RegisterSignal(drifting_loop, COMSIG_MOVELOOP_POSTPROCESS, .proc/after_move)
|
||||
RegisterSignal(drifting_loop, COMSIG_PARENT_QDELETING, .proc/loop_death)
|
||||
if(drifting_loop.running)
|
||||
drifting_start(drifting_loop) // There's a good chance it'll autostart, gotta catch that
|
||||
|
||||
/datum/component/drift/Destroy()
|
||||
inertia_last_loc = null
|
||||
@@ -49,6 +49,7 @@
|
||||
var/atom/movable/movable_parent = parent
|
||||
inertia_last_loc = movable_parent.loc
|
||||
RegisterSignal(movable_parent, COMSIG_MOVABLE_MOVED, .proc/handle_move)
|
||||
RegisterSignal(movable_parent, COMSIG_MOVABLE_NEWTONIAN_MOVE, .proc/newtonian_impulse)
|
||||
|
||||
/datum/component/drift/proc/drifting_stop()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
Reference in New Issue
Block a user