Merge pull request #10151 from Ghommie/Ghommie-cit450
refactors area code to allow for multiple areas to share the same APC, fire, air alarms etc.
This commit is contained in:
@@ -53,11 +53,11 @@
|
||||
if(NONE)
|
||||
return FALSE
|
||||
if(POWER_REQ_ALL)
|
||||
return !T || !A || ((!A.power_equip || isspaceturf(T)) && !is_type_in_list(loc, list(/obj/item, /obj/mecha)))
|
||||
return !T || !A || ((!A.powered(EQUIP) || isspaceturf(T)) && !is_type_in_list(loc, list(/obj/item, /obj/mecha)))
|
||||
if(POWER_REQ_CLOCKCULT)
|
||||
for(var/obj/effect/clockwork/sigil/transmission/ST in range(src, SIGIL_ACCESS_RANGE))
|
||||
return FALSE
|
||||
return !T || !A || (!istype(T, /turf/open/floor/clockwork) && (!A.power_equip || isspaceturf(T)) && !is_type_in_list(loc, list(/obj/item, /obj/mecha)))
|
||||
return !T || !A || (!istype(T, /turf/open/floor/clockwork) && (!A.powered(EQUIP) || isspaceturf(T)) && !is_type_in_list(loc, list(/obj/item, /obj/mecha)))
|
||||
|
||||
/mob/living/silicon/ai/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
@@ -100,7 +100,7 @@
|
||||
sleep(50)
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/AIarea = get_area(src)
|
||||
if(AIarea && AIarea.power_equip)
|
||||
if(AIarea && AIarea.powered(EQUIP))
|
||||
if(!isspaceturf(T))
|
||||
ai_restore_power()
|
||||
return
|
||||
@@ -120,7 +120,7 @@
|
||||
var/PRP //like ERP with the code, at least this stuff is no more 4x sametext
|
||||
for (PRP=1, PRP<=4, PRP++)
|
||||
T = get_turf(src)
|
||||
AIarea = get_area(src)
|
||||
AIarea = get_base_area(src)
|
||||
if(AIarea)
|
||||
for (var/obj/machinery/power/apc/APC in AIarea)
|
||||
if (!(APC.stat & BROKEN))
|
||||
@@ -134,7 +134,7 @@
|
||||
to_chat(src, "Lost connection with the APC!")
|
||||
aiRestorePowerRoutine = POWER_RESTORATION_SEARCH_APC
|
||||
return
|
||||
if(AIarea.power_equip)
|
||||
if(AIarea.powered(EQUIP))
|
||||
if(!isspaceturf(T))
|
||||
ai_restore_power()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user