Skip to content

Commit

Permalink
Replaces destroyed event with a signal on following (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDinamit authored Feb 11, 2024
1 parent ac5b2e5 commit 407e396
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/modules/mob/observer/following.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
/mob/observer/proc/stop_following()
if(!following)
return
GLOB.destroyed_event.unregister(following, src)
UnregisterSignal(following, COMSIG_PARENT_QDELETING)
GLOB.moved_event.unregister(following, src)
GLOB.dir_set_event.unregister(following, src)
following = null

/mob/observer/proc/start_following(var/atom/a)
stop_following()
following = a
GLOB.destroyed_event.register(a, src, .proc/stop_following)
RegisterSignal(a, COMSIG_PARENT_QDELETING, .proc/stop_following)
GLOB.moved_event.register(a, src, .proc/keep_following)
GLOB.dir_set_event.register(a, src, /atom/proc/recursive_dir_set)
keep_following(new_loc = get_turf(following))
Expand Down

0 comments on commit 407e396

Please sign in to comment.