mirror of
https://github.com/goonstation/goonstation-2020.git
synced 2026-08-23 03:56:15 +01:00
27 lines
708 B
Plaintext
27 lines
708 B
Plaintext
var/global/list/teleareas
|
|
|
|
proc/get_teleareas()
|
|
if (isnull(teleareas))
|
|
generate_teleareas()
|
|
return teleareas
|
|
|
|
proc/get_telearea(var/name)
|
|
var/list/areas = get_teleareas()
|
|
return areas[name]
|
|
|
|
proc/generate_teleareas()
|
|
var/area/a
|
|
LAGCHECK(LAG_HIGH)
|
|
teleareas = list()
|
|
for (var/turf/T in bounds(1, 1, world.maxx * world.icon_size, world.maxy * world.icon_size, 1))
|
|
a = T.loc
|
|
// this is gross sorry
|
|
if (!a || !isarea(a) || teleareas.Find(a.name) || istype(a, /area/cordon) || a.type == "/area" || a.name == "Space")
|
|
continue
|
|
if (istype(a, /area/wizard_station))
|
|
var/entry = text("* []", a.name)
|
|
teleareas[entry] = a
|
|
continue
|
|
teleareas[a.name] = a
|
|
teleareas = sortList(teleareas)
|