From 4ea5c00f0bdb6e0fee3b0149ef744c7de4046eb0 Mon Sep 17 00:00:00 2001 From: tattle <66640614+dragomagol@users.noreply.github.com> Date: Thu, 8 Sep 2022 05:23:34 -0700 Subject: [PATCH] Cleans up populate world code (#69752) * cleans up populate world * fix debug text * cleanup Co-authored-by: tattle --- code/modules/admin/admin_verbs.dm | 35 ++++++------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 0e42740077b..5d82efe3e58 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -760,39 +760,16 @@ GLOBAL_PROTECT(admin_verbs_poll) log_admin("[src] re-adminned themselves.") SSblackbox.record_feedback("tally", "admin_verb", 1, "Readmin") -/client/proc/populate_world(amount = 50 as num) +/client/proc/populate_world(amount = 50) set name = "Populate World" set category = "Debug" set desc = "(\"Amount of mobs to create\") Populate the world with test mobs." - if (amount > 0) - var/area/area - var/list/candidates - var/turf/open/floor/tile - var/j,k - - for (var/i = 1 to amount) - j = 100 - - do - area = pick(GLOB.the_station_areas) - - if (area) - - candidates = get_area_turfs(area) - - if (length(candidates)) - k = 100 - - do - tile = pick(candidates) - while ((!tile || !istype(tile)) && --k > 0) - - if (tile) - var/mob/living/carbon/human/hooman = new(tile) - hooman.equipOutfit(pick(subtypesof(/datum/outfit))) - testing("Spawned test mob at [COORD(tile)]") - while (!area && --j > 0) + for (var/i in 1 to amount) + var/turf/tile = get_safe_random_station_turf() + var/mob/living/carbon/human/hooman = new(tile) + hooman.equipOutfit(pick(subtypesof(/datum/outfit))) + testing("Spawned test mob at [get_area_name(tile, TRUE)] ([tile.x],[tile.y],[tile.z])") /client/proc/toggle_AI_interact() set name = "Toggle Admin AI Interact"