mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 22:19:30 +01:00
Document Moved() and forwards old_locs (#59819)
- Passes the proper arguments on Moved(), forgot to do this on another PR. - Documents the proc better. - Cleans up code a little.
This commit is contained in:
@@ -385,7 +385,7 @@
|
||||
|
||||
var/list/old_locs
|
||||
if(is_multi_tile_object && isturf(loc))
|
||||
old_locs = locs.Copy()
|
||||
old_locs = locs // locs is a special list, this is effectively the same as .Copy() but with less steps
|
||||
for(var/atom/exiting_loc as anything in old_locs)
|
||||
if(!exiting_loc.Exit(src, direction))
|
||||
return
|
||||
@@ -440,7 +440,7 @@
|
||||
if(oldarea != newarea)
|
||||
newarea.Entered(src, direction)
|
||||
|
||||
Moved(oldloc, direction)
|
||||
Moved(oldloc, direction, FALSE, old_locs)
|
||||
|
||||
////////////////////////////////////////
|
||||
|
||||
@@ -542,13 +542,21 @@
|
||||
if(. && has_buckled_mobs() && !handle_buckled_mob_movement(loc, direct, glide_size_override)) //movement failed due to buckled mob(s)
|
||||
return FALSE
|
||||
|
||||
//Called after a successful Move(). By this point, we've already moved
|
||||
/atom/movable/proc/Moved(atom/OldLoc, Dir, Forced = FALSE)
|
||||
|
||||
/**
|
||||
* Called after a successful Move(). By this point, we've already moved.
|
||||
* Arguments:
|
||||
* * old_loc is the location prior to the move. Can be null to indicate nullspace.
|
||||
* * movement_dir is the direction the movement took place. Can be NONE if it was some sort of teleport.
|
||||
* * The forced flag indicates whether this was a forced move, which skips many checks of regular movement.
|
||||
* * The old_locs is an optional argument, in case the moved movable was present in multiple locations before the movement.
|
||||
**/
|
||||
/atom/movable/proc/Moved(atom/old_loc, movement_dir, forced = FALSE, list/old_locs)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
if (!inertia_moving)
|
||||
inertia_next_move = world.time + inertia_move_delay
|
||||
newtonian_move(Dir)
|
||||
newtonian_move(movement_dir)
|
||||
if (length(client_mobs_in_contents))
|
||||
update_parallax_contents()
|
||||
|
||||
@@ -556,7 +564,7 @@
|
||||
if(move_stacks > 0)
|
||||
return
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_MOVABLE_MOVED, OldLoc, Dir, Forced)
|
||||
SEND_SIGNAL(src, COMSIG_MOVABLE_MOVED, old_loc, movement_dir, forced, old_locs)
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user