From 0bd697805d2fccddf79e6f9375a9064edfb2c840 Mon Sep 17 00:00:00 2001 From: Markolie Date: Fri, 18 Sep 2015 17:38:15 +0200 Subject: [PATCH] Update event turf handling, fix infestation event --- code/__HELPERS/unsorted.dm | 7 +++++++ code/modules/events/infestation.dm | 5 +---- code/modules/hydroponics/spreading/spreading.dm | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 9b8980b693f..21de59e0216 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1801,3 +1801,10 @@ var/mob/dview/dview_mob = new I.pixel_y = y_offset return I + +/proc/turf_clear(turf/T) + for(var/atom/A in T) + if(A.simulated) + return 0 + return 1 + \ No newline at end of file diff --git a/code/modules/events/infestation.dm b/code/modules/events/infestation.dm index b4a659491c4..ee2aa2de868 100644 --- a/code/modules/events/infestation.dm +++ b/code/modules/events/infestation.dm @@ -58,13 +58,10 @@ spawn_area_type = /area/security/securearmoury locstring = "armory" - //world << "looking for [spawn_area_type]" for(var/areapath in typesof(spawn_area_type)) - //world << " checking [areapath]" var/area/A = locate(areapath) - //world << " A: [A], contents.len: [A.contents.len]" for(var/turf/simulated/floor/F in A.contents) - if(!F.contents.len) + if(turf_clear(F)) turfs += F var/list/spawn_types = list() diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index f946d2a7147..1a5370910d0 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -7,7 +7,7 @@ for(var/areapath in typesof(/area/hallway)) var/area/A = locate(areapath) for(var/turf/simulated/floor/F in A.contents) - if(!F.contents.len <= 1) // Floors always have a lighting overlay + if(turf_clear(F)) turfs += F if(turfs.len) //Pick a turf to spawn at if we can