Moved makepowernets() into SSmachines initialization proc.

This commit is contained in:
Leshana
2017-12-28 15:21:14 -05:00
parent a97a574278
commit a1734c97e9
7 changed files with 8 additions and 24 deletions

View File

@@ -104,7 +104,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
sleep(8)
if(!powernet_rebuild_was_deferred_already && defer_powernet_rebuild)
makepowernets()
SSmachines.makepowernets()
defer_powernet_rebuild = 0
return 1

View File

@@ -277,9 +277,9 @@
/client/proc/cmd_debug_make_powernets()
set category = "Debug"
set name = "Make Powernets"
makepowernets()
log_admin("[key_name(src)] has remade the powernet. makepowernets() called.")
message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.", 0)
SSmachines.makepowernets()
log_admin("[key_name(src)] has remade the powernet. SSmachines.makepowernets() called.")
message_admins("[key_name_admin(src)] has remade the powernets. SSmachines.makepowernets() called.", 0)
feedback_add_details("admin_verb","MPWN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_debug_tog_aliens()

View File

@@ -98,7 +98,7 @@ var/list/global/map_templates = list()
admin_notice("<span class='danger'>[i] pipe\s initialized.</span>", R_DEBUG)
admin_notice("<span class='danger'>Rebuilding powernets due to submap creation.</span>", R_DEBUG)
makepowernets()
SSmachines.makepowernets()
admin_notice("<span class='danger'>Submap initializations finished.</span>", R_DEBUG)

View File

@@ -84,7 +84,7 @@
user << "<font color='blue'>You secure the generator to the floor.</font>"
else
user << "<font color='blue'>You unsecure the generator from the floor.</font>"
makepowernets()
SSmachines.makepowernets()
else if(istype(O, /obj/item/weapon/screwdriver))
open = !open
playsound(loc, O.usesound, 50, 1)

View File

@@ -230,22 +230,6 @@
. += C
return .
/hook/startup/proc/buildPowernets()
return makepowernets()
// rebuild all power networks from scratch - only called at world creation or by the admin verb
/proc/makepowernets()
for(var/datum/powernet/PN in powernets)
qdel(PN)
powernets.Cut()
for(var/obj/structure/cable/PC in cable_list)
if(!PC.powernet)
var/datum/powernet/NewPN = new()
NewPN.add_cable(PC)
propagate_network(PC,PC.powernet)
return 1
//remove the old powernet and replace it with a new one throughout the network.
/proc/propagate_network(var/obj/O, var/datum/powernet/PN)
//world.log << "propagating new network"

View File

@@ -221,7 +221,7 @@
break
if(update_power)
makepowernets()
SSmachines.makepowernets()
return
//returns 1 if the shuttle has a valid arrive time

View File

@@ -103,7 +103,7 @@
origin.move_contents_to(destination)
if((locate(/obj/machinery/power) in destination) || (locate(/obj/structure/cable) in destination))
makepowernets()
SSmachines.makepowernets()
current_floor = next_floor
control_panel_interior.visible_message("The elevator [moving_upwards ? "rises" : "descends"] smoothly.")