Fixes #3096 which exists because T != U.
Fixes #3461 which exists because I should read the code I'm refactoring instead of getting carried away by RANGE_TURFS being faster.
This commit is contained in:
Erki
2017-10-22 02:37:30 +03:00
committed by GitHub
parent a155680d73
commit 42e843d20d
3 changed files with 26 additions and 2 deletions
+20 -1
View File
@@ -238,8 +238,27 @@
//grab the border tiles in a circle around this machine
/obj/machinery/shield_gen/proc/get_shielded_turfs()
var/turf/gen_turf = get_turf(src)
. = list()
if (!gen_turf)
return
. = RANGE_TURFS(field_radius, gen_turf)
var/turf/T
for (var/x_offset = -field_radius; x_offset <= field_radius; x_offset++)
T = locate(gen_turf.x + x_offset, gen_turf.y - field_radius, gen_turf.z)
if (T)
. += T
T = locate(gen_turf.x + x_offset, gen_turf.y + field_radius, gen_turf.z)
if (T)
. += T
for (var/y_offset = -field_radius+1; y_offset < field_radius; y_offset++)
T = locate(gen_turf.x - field_radius, gen_turf.y + y_offset, gen_turf.z)
if (T)
. += T
T = locate(gen_turf.x + field_radius, gen_turf.y + y_offset, gen_turf.z)
if (T)
. += T
@@ -28,7 +28,7 @@
continue
if (the_station_areas[U.loc])
out += U
out += T
break
return out