From 29c0734905a342580b5eec665312557f7ca5f123 Mon Sep 17 00:00:00 2001 From: Purpose Date: Sun, 30 Sep 2018 17:28:47 +0100 Subject: [PATCH] get area master does nothing! --- code/__HELPERS/game.dm | 16 +++++----------- code/game/area/areas.dm | 6 +++--- code/game/atoms_movable.dm | 4 ++-- .../machinery/atmoalter/area_atmos_computer.dm | 2 +- code/game/machinery/lightswitch.dm | 2 +- code/game/machinery/machinery.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 2 +- .../modular_computers/hardware/recharger.dm | 2 +- code/modules/power/apc.dm | 3 +-- code/modules/power/lighting.dm | 7 ++++--- code/modules/power/power.dm | 10 ++++++---- 11 files changed, 26 insertions(+), 30 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index b62f32c2da9..8b034205659 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -7,12 +7,6 @@ src:Topic(href, href_list) return null -/proc/get_area_master(const/O) - var/area/A = get_area(O) - - if(isarea(A)) - return A - /proc/get_area(atom/A) if(!istype(A)) return @@ -392,23 +386,23 @@ /proc/mobs_in_area(var/area/the_area, var/client_needed=0, var/moblist=mob_list) var/list/mobs_found[0] - var/area/our_area = get_area_master(the_area) + var/area/our_area = get_area(the_area) for(var/mob/M in moblist) if(client_needed && !M.client) continue - if(our_area != get_area_master(M)) + if(our_area != get_area(M)) continue mobs_found += M return mobs_found /proc/alone_in_area(var/area/the_area, var/mob/must_be_alone, var/check_type = /mob/living/carbon) - var/area/our_area = get_area_master(the_area) + var/area/our_area = get_area(the_area) for(var/C in living_mob_list) if(!istype(C, check_type)) continue if(C == must_be_alone) continue - if(our_area == get_area_master(C)) + if(our_area == get_area(C)) return 0 return 1 @@ -518,4 +512,4 @@ proc/pollCandidates(Question, be_special_type, antag_age_check = 0, poll_time = C = M.client if(!C || !C.prefs.windowflashing) return - winset(C, "mainwindow", "flash=5") \ No newline at end of file + winset(C, "mainwindow", "flash=5") diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index d8dabdb4a10..39064d1cf3b 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -309,8 +309,8 @@ var/mob/M=A if(!M.lastarea) - M.lastarea = get_area_master(M) - newarea = get_area_master(M) + M.lastarea = get_area(M) + newarea = get_area(M) oldarea = M.lastarea if(newarea==oldarea) return @@ -400,4 +400,4 @@ CRASH("Bad op: area/AllowDrop() called") /area/drop_location() - CRASH("Bad op: area/drop_location() called") \ No newline at end of file + CRASH("Bad op: area/drop_location() called") diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 50a578cc3b3..36d3ce81ea2 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -26,7 +26,7 @@ /atom/movable/New() . = ..() - areaMaster = get_area_master(src) + areaMaster = get_area(src) /atom/movable/attempt_init() var/turf/T = get_turf(src) @@ -433,6 +433,6 @@ var/mob/M = src t_color = M.a_intent == INTENT_HARM ? "#ff0000" : "#ffffff" animate(I, alpha = 175, pixel_x = 0, pixel_y = 0, pixel_z = 0, time = 3, color = t_color) - + /atom/movable/proc/portal_destroyed(obj/effect/portal/P) return diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm index 21bda36ef3c..990488ad624 100644 --- a/code/game/machinery/atmoalter/area_atmos_computer.dm +++ b/code/game/machinery/atmoalter/area_atmos_computer.dm @@ -163,7 +163,7 @@ var/turf/T = get_turf(src) if(!T.loc) return - var/area/A = get_area_master(T) + var/area/A = get_area(T) for(var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber in world ) var/turf/T2 = get_turf(scrubber) if(T2 && T2.loc) diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 343734804cb..d0399dfa2a4 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -33,7 +33,7 @@ if(radio_controller) set_frequency(frequency) spawn(5) - src.area = src.loc.loc + src.area = get_area(src) if(otherarea) src.area = locate(text2path("/area/[otherarea]")) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 6f080b8351b..c5fd19a1cfc 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -127,7 +127,7 @@ Class Procs: /obj/machinery/proc/addAtProcessing() if(use_power) - myArea = get_area_master(src) + myArea = get_area(src) if(!speed_process) if(!defer_process) START_PROCESSING(SSmachines, src) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 933ef9a6403..f20ba3b734d 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -207,7 +207,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp for(var/obj/effect/step_trigger/S in locate(x, y, z)) //<-- this is dumb S.Crossed(src) - var/area/A = get_area_master(src) + var/area/A = get_area(src) if(A) A.Entered(src) diff --git a/code/modules/modular_computers/hardware/recharger.dm b/code/modules/modular_computers/hardware/recharger.dm index 4dc67011378..688d689cf67 100644 --- a/code/modules/modular_computers/hardware/recharger.dm +++ b/code/modules/modular_computers/hardware/recharger.dm @@ -39,7 +39,7 @@ else var/area/A = get_area(src) - if(!A || !isarea(A)) + if(!istype(A)) return 0 if(A.powered(EQUIP)) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index a0df2084b2f..f4894b2c120 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -161,7 +161,7 @@ if(building==0) init() else - area = src.loc.loc + area = get_area(src) area.apc |= src opened = 1 operating = 0 @@ -1068,7 +1068,6 @@ if(prob(3)) src.locked = 1 if(src.cell.charge > 0) -// to_chat(world, "blew APC in [src.loc.loc]") src.cell.charge = 0 cell.corrupt() src.malfhack = 1 diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index f83b00ec0d3..38b9d9220d5 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -396,7 +396,7 @@ // returns whether this light has power // true if area has power and lightswitch is on /obj/machinery/light/proc/has_power() - var/area/A = src.loc.loc + var/area/A = get_area(src) return A.lightswitch && A.power_light /obj/machinery/light/proc/flicker(var/amount = rand(10, 20)) @@ -584,8 +584,9 @@ // called when area power state changes /obj/machinery/light/power_change() - var/area/A = get_area_master(src) - if(A) seton(A.lightswitch && A.power_light) + var/area/A = get_area(src) + if(A) + seton(A.lightswitch && A.power_light) // called when on fire diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 0e255a804fe..69b27eff562 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -59,11 +59,13 @@ // defaults to power_channel /obj/machinery/proc/powered(var/chan = -1) // defaults to power_channel - if(!src.loc) + if(!loc) return 0 + if(!use_power) + return 1 - var/area/A = src.loc.loc // make sure it's in an area - if(!A || !isarea(A)) + var/area/A = get_area(src) // make sure it's in an area + if(!A) return 0 // if not, then not powered if(chan == -1) chan = power_channel @@ -72,7 +74,7 @@ // increment the power usage stats for an area /obj/machinery/proc/use_power(var/amount, var/chan = -1) // defaults to power_channel var/area/A = get_area(src) // make sure it's in an area - if(!A || !isarea(A)) + if(!A) return if(chan == -1) chan = power_channel