mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] Refactors move procs to support multitle objects (#6423)
* Refactors move procs to support multitle objects * Update _blob.dm Co-authored-by: Rohesie <rohesie@gmail.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
co-authored by
Rohesie
Gandalf
parent
3d784d4c1e
commit
d85a02babd
@@ -11,26 +11,32 @@
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/on_target_move)
|
||||
var/atom/movable/movable_target = target
|
||||
if(isturf(movable_target.loc))
|
||||
var/turf/turf_loc = movable_target.loc
|
||||
if(!isturf(movable_target.loc))
|
||||
return
|
||||
for(var/turf/turf_loc as anything in movable_target.locs)
|
||||
turf_loc.add_opacity_source(target)
|
||||
|
||||
|
||||
/datum/element/light_blocking/Detach(atom/movable/target)
|
||||
/datum/element/light_blocking/Detach(datum/target)
|
||||
. = ..()
|
||||
UnregisterSignal(target, list(COMSIG_MOVABLE_MOVED))
|
||||
var/atom/movable/movable_target = target
|
||||
if(isturf(movable_target.loc))
|
||||
var/turf/turf_loc = movable_target.loc
|
||||
if(!isturf(movable_target.loc))
|
||||
return
|
||||
for(var/turf/turf_loc as anything in movable_target.locs)
|
||||
turf_loc.remove_opacity_source(target)
|
||||
|
||||
|
||||
///Updates old and new turf loc opacities.
|
||||
/datum/element/light_blocking/proc/on_target_move(atom/movable/source, atom/OldLoc, Dir, Forced = FALSE)
|
||||
/datum/element/light_blocking/proc/on_target_move(atom/movable/source, atom/old_loc, dir, forced, list/old_locs)
|
||||
SIGNAL_HANDLER
|
||||
if(isturf(OldLoc))
|
||||
var/turf/old_turf = OldLoc
|
||||
old_turf.remove_opacity_source(source)
|
||||
if(isturf(old_loc))
|
||||
if(old_locs)
|
||||
for(var/turf/old_turf as anything in old_locs)
|
||||
old_turf.remove_opacity_source(source)
|
||||
else
|
||||
var/turf/old_turf = old_loc
|
||||
old_turf.remove_opacity_source(source)
|
||||
if(isturf(source.loc))
|
||||
var/turf/new_turf = source.loc
|
||||
new_turf.add_opacity_source(source)
|
||||
for(var/turf/new_turf as anything in source.locs)
|
||||
new_turf.add_opacity_source(source)
|
||||
|
||||
Reference in New Issue
Block a user