Merge pull request #9883 from mwerezak/ert-lights

Adds more coloured lights
This commit is contained in:
Chinsky
2015-08-13 07:22:45 +03:00
3 changed files with 50 additions and 35 deletions

View File

@@ -7,11 +7,19 @@
var/list/light_sources
/atom/proc/set_light(l_range, l_power, l_color)
if(l_power != null) light_power = l_power
if(l_range != null) light_range = l_range
if(l_color != null) light_color = l_color
. = 0 //make it less costly if nothing's changed
update_light()
if(l_power != null && l_power != light_power)
light_power = l_power
. = 1
if(l_range != null && l_range != light_range)
light_range = l_range
. = 1
if(l_color != null && l_color != light_color)
light_color = l_color
. = 1
if(.) update_light()
/atom/proc/update_light()
if(!light_power || !light_range)