From eec3bdf932a96e1818dbf39c52c7f50861d03b2c Mon Sep 17 00:00:00 2001 From: DamianX Date: Wed, 28 Feb 2018 08:53:52 +0100 Subject: [PATCH] Remove area_in_map proc (#17638) * Remove area_in_map proc * macro edition --- code/__HELPERS/_macros.dm | 6 +++++- code/__HELPERS/unsorted.dm | 13 +++---------- code/controllers/shuttle_controller.dm | 4 +--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/code/__HELPERS/_macros.dm b/code/__HELPERS/_macros.dm index 84f8b43ab7f..7efcbe515bf 100644 --- a/code/__HELPERS/_macros.dm +++ b/code/__HELPERS/_macros.dm @@ -270,4 +270,8 @@ proc/get_space_area() #define LIBVG(function, arguments...) call("./libvg.[world.system_type == UNIX ? "so" : "dll"]", function)(arguments) -#define SNOW_THEME (map.snow_theme || Holiday == "Christmas Eve" || Holiday == "Christmas") \ No newline at end of file +// For areas that are on the map, `x` is the coordinate of the turf with the lowest z, y, and x coordinate (in that order) that is contained by the area. +#define is_area_in_map(A) (A.x) + +#define SNOW_THEME (map.snow_theme || Holiday == "Christmas Eve" || Holiday == "Christmas") + diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index cf999900114..2b429295397 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1679,13 +1679,6 @@ Game Mode config tags: /proc/sentStrikeTeams(var/team) return (team in sent_strike_teams) - -/proc/area_in_map(var/area/A) - for (var/turf/T in A.area_turfs) - return TRUE - return FALSE - - /proc/get_exact_dist(atom/A, atom/B) //returns the coordinate distance between the coordinates of the turfs of A and B var/turf/T1 = A var/turf/T2 = B @@ -1713,17 +1706,17 @@ Game Mode config tags: if(user) user.drop_item(O, force_drop = TRUE) - + if(istype(O, /obj/item/weapon/grown)) var/obj/item/weapon/grown/F = O if(F.plantname) new_seed_type = plant_controller.seeds[F.plantname] - else + else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown)) var/obj/item/weapon/reagent_containers/food/snacks/grown/F = O if(F.plantname) new_seed_type = plant_controller.seeds[F.plantname] - else + else var/obj/item/F = O if(F.nonplant_seed_type) while(min_seeds <= produce) diff --git a/code/controllers/shuttle_controller.dm b/code/controllers/shuttle_controller.dm index 0fe61bd8000..e2f0b27ab67 100644 --- a/code/controllers/shuttle_controller.dm +++ b/code/controllers/shuttle_controller.dm @@ -45,10 +45,8 @@ datum/emergency_shuttle/proc/init() var/list/pods_to_test = list ("1","2","3","5")//ADD NEW PODS HERE for (var/i in pods_to_test) var/area/pod_test = locate(text2path("/area/shuttle/escape_pod[i]/station")) - if (area_in_map(pod_test)) + if (is_area_in_map(pod_test)) escape_pods[i] = "station" - - datum/emergency_shuttle/proc/incall(coeff = 1) if(shutdown) return