mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 01:57:01 +00:00
Fixes powernet avail checks (#47771)
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
damage_deflection = 10
|
||||
resistance_flags = FIRE_PROOF
|
||||
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON
|
||||
ui_x = 450
|
||||
ui_x = 450
|
||||
ui_y = 460
|
||||
|
||||
var/lon_range = 1.5
|
||||
@@ -1120,9 +1120,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
|
||||
|
||||
|
||||
@@ -210,9 +210,9 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
|
||||
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
|
||||
|
||||
|
||||
@@ -51,9 +51,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
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
index++
|
||||
|
||||
var/list/connections = working_cable.get_cable_connections(skip_assigned_powernets)
|
||||
|
||||
|
||||
for(var/obj/structure/cable/cable_entry in connections)
|
||||
if(!cables[cable_entry]) //Since it's an associated list, we can just do an access and check it's null before adding; prevents duplicate entries
|
||||
cables[cable_entry] = TRUE
|
||||
|
||||
Reference in New Issue
Block a user