Ports "Fixes powernet avail checks"

This commit is contained in:
Ghommie
2019-12-12 17:35:35 +01:00
parent f637e1e060
commit bc2e6a7f9b
3 changed files with 6 additions and 6 deletions

View File

@@ -1113,9 +1113,9 @@
if(terminal && terminal.powernet)
terminal.add_load(amount)
/obj/machinery/power/apc/avail()
/obj/machinery/power/apc/avail(amount)
if(terminal)
return terminal.avail()
return terminal.avail(amount)
else
return 0

View File

@@ -217,9 +217,9 @@ By design, d1 is the smallest direction and d2 is the highest
else
return 0
/obj/structure/cable/proc/avail()
/obj/structure/cable/proc/avail(amount)
if(powernet)
return powernet.avail
return amount ? powernet.avail >= amount : powernet.avail
else
return 0

View File

@@ -46,9 +46,9 @@
else
return 0
/obj/machinery/power/proc/avail()
/obj/machinery/power/proc/avail(amount)
if(powernet)
return powernet.avail
return amount ? powernet.avail >= amount : powernet.avail
else
return 0