Refactor Move() code

This commit is contained in:
Aronai Sieyes
2020-04-27 10:08:55 -04:00
parent ab179d74a2
commit bc1fa7bd05
42 changed files with 345 additions and 407 deletions
+9 -10
View File
@@ -65,20 +65,19 @@
T.reconsider_lights()
return ..()
/atom/movable/Move()
var/turf/old_loc = loc
/atom/movable/Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
if(loc != old_loc)
for(var/datum/light_source/L in light_sources)
L.source_atom.update_light()
for(var/datum/light_source/L in light_sources)
L.source_atom.update_light()
var/turf/new_loc = loc
if(istype(old_loc) && opacity)
old_loc.reconsider_lights()
var/turf/new_turf = loc
var/turf/old_turf = old_loc
if(istype(old_turf) && opacity)
old_turf.reconsider_lights()
if(istype(new_loc) && opacity)
new_loc.reconsider_lights()
if(istype(new_turf) && opacity)
new_turf.reconsider_lights()
/atom/proc/set_opacity(new_opacity)
if(new_opacity == opacity)