mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-23 05:06:50 +01:00
Refactor Move() code
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user