Infinite Frame Fixy

Ports https://github.com/Citadel-Station-13/Citadel-Station-13-RP/pull/855 to fix runtimes for several machinery objects.
This commit is contained in:
TheFurryFeline
2019-06-03 18:14:44 -04:00
parent aca58a6864
commit e3e442e9b0
8 changed files with 38 additions and 24 deletions
+3 -2
View File
@@ -43,12 +43,13 @@
else
icon_state = "dbchime-standby"
//TFF 3/6/19 - Port Cit RP fix of infinite frames. ToDo: Make it so that you can completely deconstruct it and reconstruct it.
/obj/machinery/doorbell_chime/attackby(obj/item/W as obj, mob/user as mob)
src.add_fingerprint(user)
if(default_deconstruction_screwdriver(user, W))
return
else if(default_deconstruction_crowbar(user, W))
return
// else if(default_deconstruction_crowbar(user, W)) //NOTICE: NO CIRCUITBOARD
// return
else if(default_part_replacement(user, W))
return
else if(panel_open && istype(W, /obj/item/device/multitool))
+3 -1
View File
@@ -16,6 +16,9 @@
var/list/logs = list() // Gets written to by exonet's send_message() function.
//TFF 3/6/19 - Port Cit RP fix for infinite frames
circuit = /obj/item/weapon/circuitboard/telecomms/exonet_node
// Proc: New()
// Parameters: None
// Description: Adds components to the machine for deconstruction.
@@ -23,7 +26,6 @@
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/telecomms/exonet_node(src)
component_parts += new /obj/item/weapon/stock_parts/subspace/ansible(src)
component_parts += new /obj/item/weapon/stock_parts/subspace/sub_filter(src)
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
+4 -1
View File
@@ -329,7 +329,7 @@ Class Procs:
return FALSE
if(panel_open)
return FALSE // Close panel first!
playsound(loc, W.usesound, 50, 1)
playsound(loc, W.usesound, 50, 1)
var/actual_time = W.toolspeed * time
if(actual_time != 0)
user.visible_message( \
@@ -396,6 +396,9 @@ Class Procs:
/obj/machinery/proc/dismantle()
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
//TFF 3/6/19 - port Cit RP fix of infinite frames.
if(!circuit)
return 0
var/obj/structure/frame/A = new /obj/structure/frame(src.loc)
var/obj/item/weapon/circuitboard/M = circuit
A.circuit = M
+7 -3
View File
@@ -94,10 +94,14 @@
user << "You load [W] into [src]."
return
if(default_deconstruction_screwdriver(user, W))
return
if(default_deconstruction_crowbar(user, W))
//TFF 3/6/19 - fix infinite frame creation, ported from Cit RP
if(istype(W, /obj/item/weapon/wrench))
playsound(src, W.usesound, 100, 1)
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure \the [src].</span>")
anchored = !anchored
return
// if(default_deconstruction_crowbar(user, W))
// return
if(istype(W,/obj/item/weapon/disk/botany))
if(loaded_disk)
user << "There is already a data disk loaded."
+2 -2
View File
@@ -293,18 +293,18 @@
else
usr << "<span class='notice'>You must move an ore box up to the drill before you can unload it.</span>"
//TFF 25/5/19 - fix infinite frame issue
/obj/machinery/mining/brace
name = "mining drill brace"
desc = "A machinery brace for an industrial drill. It looks easily two feet thick."
icon_state = "mining_brace"
circuit = /obj/item/weapon/circuitboard/miningdrillbrace
var/obj/machinery/mining/drill/connected
/obj/machinery/mining/brace/New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/miningdrillbrace(src)
/obj/machinery/mining/brace/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(connected && connected.active)
+12 -15
View File
@@ -74,26 +74,23 @@
/obj/machinery/power/smes/batteryrack/chargedisplay()
return round(4 * charge/(capacity ? capacity : 5e6))
//TFF 3/6/19 - Port Cit RP fix for infinite frames
/obj/machinery/power/smes/batteryrack/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) //these can only be moved by being reconstructed, solves having to remake the powernet.
..() //SMES attackby for now handles screwdriver, cable coils and wirecutters, no need to repeat that here
if(open_hatch)
if(istype(W, /obj/item/weapon/crowbar))
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
playsound(src, W.usesound, 50, 1)
var/obj/structure/frame/M = new /obj/structure/frame(src.loc)
M.frame_type = "machine"
M.state = 2
M.icon_state = "machine_1"
for(var/obj/I in component_parts)
I.loc = src.loc
qdel(src)
return 1
else
user << "<span class='warning'>Turn off the [src] before dismantling it.</span>"
if(charge < (capacity/100))
if (output_attempt || input_attempt)
to_chat(user, "<span class='warning'>Turn off \the [src] before dismantling it.</span>")
return
if(terminal)
to_chat(user, "<span class='warning'>You have to disassemble the terminal first!</span>")
return
return dismantle()
else
user << "<span class='warning'>Better let [src] discharge before dismantling it.</span>"
to_chat(user, "<span class='warning'>Better let \the [src] discharge before dismantling it.</span>")
return
else if ((istype(W, /obj/item/weapon/stock_parts/capacitor) && (capacitors_amount < 5)) || (istype(W, /obj/item/weapon/cell) && (cells_amount < 5)))
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
+1
View File
@@ -102,6 +102,7 @@
can_buckle = TRUE
buckle_lying = FALSE
circuit = /obj/item/weapon/circuitboard/grounding_rod
/obj/machinery/power/grounding_rod/update_icon()
if(panel_open)
@@ -0,0 +1,6 @@
author: TheFurryFeline
delete-after: True
changes:
- bugfix: "Fixes infinite frame production for mining drill braces and doorbell chimes and other machines. If there's no available circuit board to get, then don't return anything when attempting deconstruction. Ported from Cit RP. Eliminates 'Cannot read null.board_type' runtimes where they apply."