From 248b2d49cec715e99b80b86febd2da57d1fc1ee1 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 8 Sep 2022 18:54:56 +0200 Subject: [PATCH] [MIRROR] Cleans up populate world code [MDB IGNORE] (#16129) * Cleans up populate world code (#69752) * cleans up populate world * fix debug text * cleanup Co-authored-by: tattle * Cleans up populate world code Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com> 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 ebd2221928c..ac00350a4e2 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -789,39 +789,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"