Inhibitor Check Fix (#10980)

This commit is contained in:
Geeves
2021-01-15 03:27:41 +02:00
committed by GitHub
parent f372a3c45a
commit e4b7d61e67
4 changed files with 29 additions and 7 deletions

View File

@@ -42,16 +42,15 @@
if(istype(adestination)) if(istype(adestination))
var/list/turf/good_turfs = list() var/list/turf/good_turfs = list()
var/list/turf/bad_turfs = list() var/list/turf/bad_turfs = list()
for(var/found_inhibitor in circlerange(adestination,8)) var/turf/T = get_turf(adestination)
if(!istype(found_inhibitor,/obj/machinery/anti_bluespace)) for(var/found_inhibitor in bluespace_inhibitors)
continue
var/obj/machinery/anti_bluespace/AB = found_inhibitor 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 continue
AB.use_power(AB.active_power_usage) AB.use_power(AB.active_power_usage)
bad_turfs += circlerangeturfs(get_turf(AB),8) bad_turfs += circlerangeturfs(get_turf(AB),8)
good_turfs += circlerangeturfs(get_turf(AB),9) 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 good_turfs -= bad_turfs
return pick(good_turfs) return pick(good_turfs)

View File

@@ -1,3 +1,5 @@
var/global/list/bluespace_inhibitors
/obj/machinery/anti_bluespace /obj/machinery/anti_bluespace
name = "bluespace inhibitor" name = "bluespace inhibitor"
desc = "Scrambles any bluespace related activity and displaces it away from the beacon's area of effect." 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 active_power_usage = 5000
idle_power_usage = 1000 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() /obj/machinery/anti_bluespace/update_icon()
. = ..() . = ..()
if(stat & BROKEN) if(stat & BROKEN)

View File

@@ -921,6 +921,14 @@ var/list/total_extraction_beacons = list()
return return
if(A.anchored) if(A.anchored)
return 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]...")) to_chat(user, SPAN_NOTICE("You start attaching the pack to \the [A]..."))
if(do_after(user,50)) if(do_after(user,50))
to_chat(user, SPAN_NOTICE("You attach the pack to \the [A] and activate it.")) 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) var/area/area_name = get_area(src)
name += " ([rand(100,999)]) ([area_name.name])" name += " ([rand(100,999)]) ([area_name.name])"
total_extraction_beacons += src total_extraction_beacons += src
..()
/obj/structure/extraction_point/Destroy() /obj/structure/extraction_point/Destroy()
total_extraction_beacons -= src total_extraction_beacons -= src
. = ..() return ..()
/**********************Resonator**********************/ /**********************Resonator**********************/

View File

@@ -0,0 +1,6 @@
author: Geeves
delete-after: True
changes:
- bugfix: "Bluespace inhibitors now inhibit warp extraction packs."