From 50fc1004bace7d480599f9d3a38a148baa676a91 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sat, 2 Nov 2019 16:46:02 +0100 Subject: [PATCH] Actually holopads, so they won't end up in maintenance... --- code/game/machinery/hologram.dm | 11 +++---- code/modules/holiday/halloween/jacqueen.dm | 34 +++++++--------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 893f36acb3..79aef8ba7b 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -24,6 +24,8 @@ Possible to do for anyone motivated enough: * Holopad */ +GLOBAL_LIST_EMPTY(network_holopads) + #define HOLOPAD_PASSIVE_POWER_USAGE 1 #define HOLOGRAM_POWER_USAGE 2 @@ -55,7 +57,6 @@ Possible to do for anyone motivated enough: var/record_user //user that inititiated the recording var/obj/effect/overlay/holo_pad_hologram/replay_holo //replay hologram var/static/force_answer_call = FALSE //Calls will be automatically answered after a couple rings, here for debugging - var/static/list/holopads = list() var/obj/effect/overlay/holoray/ray var/ringing = FALSE var/offset = FALSE @@ -96,7 +97,7 @@ Possible to do for anyone motivated enough: /obj/machinery/holopad/Initialize() . = ..() if(on_network) - holopads += src + GLOB.network_holopads += src /obj/machinery/holopad/Destroy() if(outgoing_call) @@ -116,7 +117,7 @@ Possible to do for anyone motivated enough: QDEL_NULL(disk) - holopads -= src + GLOB.network_holopads -= src return ..() /obj/machinery/holopad/power_change() @@ -260,7 +261,7 @@ Possible to do for anyone motivated enough: temp += "Main Menu" if(usr.loc == loc) var/list/callnames = list() - for(var/I in holopads) + for(var/I in GLOB.network_holopads) var/area/A = get_area(I) if(A) LAZYADD(callnames[A], I) @@ -474,7 +475,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ var/obj/effect/overlay/holo_pad_hologram/h = masters[holo_owner] if(!h || h.HC) //Holocalls can't change source. return FALSE - for(var/pad in holopads) + for(var/pad in GLOB.network_holopads) var/obj/machinery/holopad/another = pad if(another == src) continue diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm index 4b5874d3e5..3ad4149700 100644 --- a/code/modules/holiday/halloween/jacqueen.dm +++ b/code/modules/holiday/halloween/jacqueen.dm @@ -102,39 +102,27 @@ canmove = TRUE health = 25 - var/list/areas = list() - for(var/A in GLOB.teleportlocs) - if(findtextEx(A, "AI")) - continue - areas += GLOB.teleportlocs[A] - //Try to go to populated areas var/list/pop_areas = list() for(var/M in GLOB.player_list) var/area/A = get_area(M) pop_areas += A - var/list/cool_places = uniquemergelist(areas, pop_areas) + var/list/targets = list() + for(var/H in GLOB.network_holopads) + var/area/A = get_area(H) + if(findtextEx(A, "AI") || !(A in pop_areas) || !is_station_level(H)) + continue + targets += H - if(!cool_places.len) - cool_places = areas + if(!targets) + targets = GLOB.generic_event_spawns for(var/i in 1 to 6) //Attempts a jump up to 6 times. - var/area/A = pick(cool_places) - var/list/area_turfs = list(get_area_turfs(A.type)) - - if(i != 6) // We need to teleport away, no matter what. - for(var/t in area_turfs) - var/turf/T = t - if(!is_blocked_turf(T)) - L -= T - if(!L.len) - cool_places -= A - continue - - if(!do_teleport(src, pick(L), channel = TELEPORT_CHANNEL_MAGIC)) + var/atom/A = pick(targets) + if(!do_teleport(src, A, channel = TELEPORT_CHANNEL_MAGIC)) return TRUE - cool_places -= A + targets -= A return FALSE /mob/living/simple_animal/jacq/proc/gender_check(mob/living/carbon/C)