mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Merge pull request #29718 from ShizCalev/apc-corrections
Fixes areastring grabbing area subtypes
This commit is contained in:
@@ -605,6 +605,18 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
GLOB.sortedAreas.Add(src)
|
||||
sortTim(GLOB.sortedAreas, /proc/cmp_name_asc)
|
||||
|
||||
//Takes: Area type as a text string from a variable.
|
||||
//Returns: Instance for the area in the world.
|
||||
/proc/get_area_instance_from_text(areatext)
|
||||
var/areainstance = null
|
||||
if(istext(areatext))
|
||||
areatext = text2path(areatext)
|
||||
for(var/V in GLOB.sortedAreas)
|
||||
var/area/A = V
|
||||
if(A.type == areatext)
|
||||
areainstance = V
|
||||
return areainstance
|
||||
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all areas of that type in the world.
|
||||
/proc/get_areas(areatype, subtypes=TRUE)
|
||||
|
||||
@@ -669,7 +669,7 @@
|
||||
return
|
||||
|
||||
if(control_area)
|
||||
control_area = locate(text2path(control_area)) in GLOB.sortedAreas
|
||||
control_area = get_area_instance_from_text(control_area)
|
||||
if(control_area == null)
|
||||
control_area = get_area(src)
|
||||
stack_trace("Bad control_area path for [src], [src.control_area]")
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
//if area isn't specified use current
|
||||
if(areastring)
|
||||
src.area = locate(text2path(areastring)) in GLOB.sortedAreas
|
||||
src.area = get_area_instance_from_text(areastring)
|
||||
if(!src.area)
|
||||
src.area = A
|
||||
stack_trace("Bad areastring path for [src], [src.areastring]")
|
||||
|
||||
Reference in New Issue
Block a user