Refactor move code

This commit is contained in:
Aronai Sieyes
2020-04-26 16:42:50 -04:00
parent 5874df8756
commit d3da6ae4a5
45 changed files with 359 additions and 429 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)