Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
makes lights trigger on forceMove using a vg change

Signed-off-by: Mloc <colmohici@gmail.com>
  • Loading branch information
mloc committed Jul 27, 2015
1 parent 1d8e015 commit aab326e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
14 changes: 3 additions & 11 deletions code/modules/lighting/lighting_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,13 @@
T.reconsider_lights()
return ..()

/atom/movable/Move()
var/turf/old_loc = loc
/atom/Entered(atom/movable/obj, atom/prev_loc)
. = ..()

if(loc != old_loc)
for(var/datum/light_source/L in light_sources)
if(obj && prev_loc != src)
for(var/datum/light_source/L in obj.light_sources)
L.source_atom.update_light()

var/turf/new_loc = loc
if(istype(old_loc) && opacity)
old_loc.reconsider_lights()

if(istype(new_loc) && opacity)
new_loc.reconsider_lights()

/atom/proc/set_opacity(new_opacity)
var/old_opacity = opacity
opacity = new_opacity
Expand Down
2 changes: 2 additions & 0 deletions code/modules/lighting/lighting_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@
var/turf/T = loc
if(istype(T))
T.lighting_overlay = null

..()
10 changes: 10 additions & 0 deletions code/modules/lighting/lighting_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@
if(A.lighting_use_dynamic)
var/atom/movable/lighting_overlay/O = PoolOrNew(/atom/movable/lighting_overlay, src)
lighting_overlay = O

/turf/Entered(atom/movable/obj)
. = ..()
if(obj && obj.opacity)
reconsider_lights()

/turf/Exited(atom/movable/obj)
. = ..()
if(obj && obj.opacity)
reconsider_lights()

0 comments on commit aab326e

Please sign in to comment.