diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index 1fb46e03890..5fd2b89a429 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -42,16 +42,15 @@ if(istype(adestination)) var/list/turf/good_turfs = list() var/list/turf/bad_turfs = list() - for(var/found_inhibitor in circlerange(adestination,8)) - if(!istype(found_inhibitor,/obj/machinery/anti_bluespace)) - continue + var/turf/T = get_turf(adestination) + for(var/found_inhibitor in bluespace_inhibitors) var/obj/machinery/anti_bluespace/AB = found_inhibitor - if(AB.stat & (NOPOWER | BROKEN) ) + if(T.z != AB.z || get_dist(adestination, AB) > 8 || (AB.stat & (NOPOWER | BROKEN))) continue AB.use_power(AB.active_power_usage) bad_turfs += circlerangeturfs(get_turf(AB),8) good_turfs += circlerangeturfs(get_turf(AB),9) - if(good_turfs.len && bad_turfs.len) + if(length(good_turfs) && length(bad_turfs)) good_turfs -= bad_turfs return pick(good_turfs) diff --git a/code/game/machinery/anti_bluespace.dm b/code/game/machinery/anti_bluespace.dm index 0c6f9382326..2d8c3e1caa6 100644 --- a/code/game/machinery/anti_bluespace.dm +++ b/code/game/machinery/anti_bluespace.dm @@ -1,3 +1,5 @@ +var/global/list/bluespace_inhibitors + /obj/machinery/anti_bluespace name = "bluespace inhibitor" desc = "Scrambles any bluespace related activity and displaces it away from the beacon's area of effect." @@ -9,6 +11,14 @@ active_power_usage = 5000 idle_power_usage = 1000 +/obj/machinery/anti_bluespace/Initialize() + . = ..() + LAZYADD(bluespace_inhibitors, src) + +/obj/machinery/anti_bluespace/Destroy() + LAZYREMOVE(bluespace_inhibitors, src) + return ..() + /obj/machinery/anti_bluespace/update_icon() . = ..() if(stat & BROKEN) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index d9d5be2f1c3..43b9ad397fd 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -921,6 +921,14 @@ var/list/total_extraction_beacons = list() return if(A.anchored) return + var/turf/T = get_turf(A) + for(var/found_inhibitor in bluespace_inhibitors) + var/obj/machinery/anti_bluespace/AB = found_inhibitor + if(T.z != AB.z || get_dist(T, AB) > 8 || (AB.stat & (NOPOWER | BROKEN))) + continue + AB.use_power(AB.active_power_usage) + to_chat(user, SPAN_WARNING("A nearby bluespace inhibitor interferes with \the [src]!")) + return to_chat(user, SPAN_NOTICE("You start attaching the pack to \the [A]...")) if(do_after(user,50)) to_chat(user, SPAN_NOTICE("You attach the pack to \the [A] and activate it.")) @@ -968,11 +976,10 @@ var/list/total_extraction_beacons = list() var/area/area_name = get_area(src) name += " ([rand(100,999)]) ([area_name.name])" total_extraction_beacons += src - ..() /obj/structure/extraction_point/Destroy() total_extraction_beacons -= src - . = ..() + return ..() /**********************Resonator**********************/ diff --git a/html/changelogs/geeves-inhibitor_check.yml b/html/changelogs/geeves-inhibitor_check.yml new file mode 100644 index 00000000000..e5be25181fe --- /dev/null +++ b/html/changelogs/geeves-inhibitor_check.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Bluespace inhibitors now inhibit warp extraction packs." \ No newline at end of file