From e257a5c2c50fd8e980a2d7afdf0795b76ba202fc Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Thu, 5 Aug 2021 21:08:57 +0200 Subject: [PATCH] Contractor pods won't land on groundless turfs such as chasms or open space anymore. (#60592) --- code/__HELPERS/game.dm | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 99aff268725..2a6c79b8ebc 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -527,21 +527,16 @@ // Find an obstruction free turf that's within the range of the center. Can also condition on if it is of a certain area type. /proc/find_obstruction_free_location(range, atom/center, area/specific_area) - var/list/turfs = RANGE_TURFS(range, center) var/list/possible_loc = list() - for(var/turf/found_turf in turfs) - var/area/turf_area = get_area(found_turf) - + for(var/turf/found_turf in RANGE_TURFS(range, center)) // We check if both the turf is a floor, and that it's actually in the area. // We also want a location that's clear of any obstructions. - if (specific_area) - if (!istype(turf_area, specific_area)) - continue + if (specific_area && !istype(get_area(found_turf), specific_area)) + continue - if (!isspaceturf(found_turf)) - if (!found_turf.is_blocked_turf()) - possible_loc.Add(found_turf) + if (!isgroundlessturf(found_turf) && !found_turf.is_blocked_turf()) + possible_loc.Add(found_turf) // Need at least one free location. if (possible_loc.len < 1)