Ports the get_area conversion to define.
This commit is contained in:
@@ -218,6 +218,9 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
|
||||
//Gets the turf this atom inhabits
|
||||
#define get_turf(A) (get_step(A, 0))
|
||||
|
||||
//Same as above except gets the area instead
|
||||
#define get_area(A) (isarea(A) ? A : get_step(A, 0)?.loc)
|
||||
|
||||
//Ghost orbit types:
|
||||
#define GHOST_ORBIT_CIRCLE "circle"
|
||||
#define GHOST_ORBIT_TRIANGLE "triangle"
|
||||
|
||||
@@ -8,12 +8,6 @@
|
||||
#define Z_TURFS(ZLEVEL) block(locate(1,1,ZLEVEL), locate(world.maxx, world.maxy, ZLEVEL))
|
||||
#define CULT_POLL_WAIT 2400
|
||||
|
||||
/proc/get_area(atom/A)
|
||||
if(isarea(A))
|
||||
return A
|
||||
var/turf/T = get_turf(A)
|
||||
return T ? T.loc : null
|
||||
|
||||
/proc/get_area_name(atom/X, format_text = FALSE)
|
||||
var/area/A = isarea(X) ? X : get_area(X)
|
||||
if(!A)
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
/obj/item/areaeditor/blueprints/attack_self(mob/user)
|
||||
. = ..()
|
||||
if(!legend)
|
||||
var/area/A = get_area()
|
||||
var/area/A = get_area(user)
|
||||
if(get_area_type() == AREA_STATION)
|
||||
. += "<p>According to \the [src], you are now in <b>\"[html_encode(A.name)]\"</b>.</p>"
|
||||
. += "<p><a href='?src=[REF(src)];edit_area=1'>Change area name</a></p>"
|
||||
@@ -140,12 +140,10 @@
|
||||
legend = FALSE
|
||||
|
||||
|
||||
/obj/item/areaeditor/proc/get_area()
|
||||
var/turf/T = get_turf(usr)
|
||||
var/area/A = T.loc
|
||||
return A
|
||||
|
||||
/obj/item/areaeditor/proc/get_area_type(area/A = get_area())
|
||||
/obj/item/areaeditor/proc/get_area_type(area/A)
|
||||
if(!A)
|
||||
A = get_area(usr)
|
||||
if(A.outdoors)
|
||||
return AREA_SPACE
|
||||
var/list/SPECIALS = list(
|
||||
@@ -183,7 +181,7 @@
|
||||
return ""
|
||||
|
||||
/obj/item/areaeditor/proc/edit_area()
|
||||
var/area/A = get_area()
|
||||
var/area/A = get_area(usr)
|
||||
var/prevname = "[A.name]"
|
||||
var/str = stripped_input(usr,"New area name:", "Area Creation", "", MAX_NAME_LEN)
|
||||
if(!str || !length(str) || str==prevname) //cancel
|
||||
|
||||
Reference in New Issue
Block a user