-Fixes Issue 1142. Thanks to carn for the solution to the issue. The tags were being cut off and there were multiple areas of the same tag, so when locating with the tag it gave out unpredictable results.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5254 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-12-04 11:10:43 +00:00
parent 517180dffe
commit 45d98a271e
+7 -7
View File
@@ -236,24 +236,24 @@ turf/proc/update_lumcount(amount)
turf/proc/shift_to_subarea()
lighting_changed = 0
var/area/Area = loc
if(!istype(Area) || !Area.lighting_use_dynamic) return
// change the turf's area depending on its brightness
// restrict light to valid levels
var/light = min(max(round(lighting_lumcount,1),0),lighting_controller.lighting_states)
//var/new_tag = "[Area.type]sd_L[light]"
var/new_tag
if(length(Area.tag) > 5)
new_tag = "[copytext(Area.tag,1,-5)]sd_L[light]"
else
new_tag = "[Area.type]sd_L[light]"
var/find = findtextEx(Area.tag, "sd_L")
var/new_tag = copytext(Area.tag, 1, find)
new_tag += "sd_L[light]"
if(Area.tag!=new_tag) //skip if already in this area
var/area/A = locate(new_tag) // find an appropriate area
if(!A)
A = new Area.type() // create area if it wasn't found
// replicate vars
for(var/V in Area.vars)