From eb58fb1e0c314cc689b32164dcbd5a49844bc673 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 22 May 2014 17:25:08 -0400 Subject: [PATCH 01/26] Fixes RD console circuit var not set. Also removes redundant attackby code, and small change to text when setting access protocol on the board. Related to issue #5006 --- .../game/machinery/computer/buildandrepair.dm | 5 +-- code/modules/research/rdconsole.dm | 34 ++++--------------- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 61784e98c3e..5772cd77565 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -277,14 +277,15 @@ /obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) if(istype(I,/obj/item/weapon/screwdriver)) + user << "\blue You adjust the jumper on the access protocol pins." if(src.build_path == "/obj/machinery/computer/rdconsole/core") src.name = "Circuit Board (RD Console - Robotics)" src.build_path = "/obj/machinery/computer/rdconsole/robotics" - user << "\blue Access protocols succesfully updated." + user << "\blue Access protocols set to robotics." else src.name = "Circuit Board (RD Console)" src.build_path = "/obj/machinery/computer/rdconsole/core" - user << "\blue Defaulting access protocols." + user << "\blue Access protocols set to default." return /obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 103969bdd11..9deb5f1fe2e 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -34,6 +34,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, /obj/machinery/computer/rdconsole name = "R&D Console" icon_state = "rdcomp" + circuit = /obj/item/weapon/circuitboard/rdconsole var/datum/research/files //Stores all the collected research data. var/obj/item/weapon/disk/tech_disk/t_disk = null //Stores the technology disk. var/obj/item/weapon/disk/design_disk/d_disk = null //Stores the design disk. @@ -141,35 +142,8 @@ won't update every console in existence) but it's more of a hassle to do. Also, */ /obj/machinery/computer/rdconsole/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) - //The construction/deconstruction of the console code. - if(istype(D, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - new /obj/item/weapon/shard( src.loc ) - var/obj/item/weapon/circuitboard/rdconsole/M = new /obj/item/weapon/circuitboard/rdconsole( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.state = 3 - A.icon_state = "3" - A.anchored = 1 - del(src) - else - user << "\blue You disconnect the monitor." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/rdconsole/M = new /obj/item/weapon/circuitboard/rdconsole( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.state = 4 - A.icon_state = "4" - A.anchored = 1 - del(src) //Loading a disk into it. - else if(istype(D, /obj/item/weapon/disk)) + if(istype(D, /obj/item/weapon/disk)) if(t_disk || d_disk) user << "A disk is already loaded into the machine." return @@ -186,6 +160,10 @@ won't update every console in existence) but it's more of a hassle to do. Also, playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) emagged = 1 user << "\blue You you disable the security protocols" + else + //The construction/deconstruction of the console code. + ..() + src.updateUsrDialog() return From 6308c2b7fe71f1a81ab88c851fe273ac718aa822 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 22 May 2014 17:34:46 -0400 Subject: [PATCH 02/26] Fixes wrong access on RD console --- code/modules/research/rdconsole.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 9deb5f1fe2e..94c27e41056 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -47,7 +47,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, var/id = 0 //ID of the computer (for server restrictions). var/sync = 1 //If sync = 0, it doesn't show up on Server Control Console - req_access = list(access_tox) //Data and setting manipulation requires scientist access. + req_access = list(access_research) //Data and setting manipulation requires scientist access. /obj/machinery/computer/rdconsole/proc/CallTechName(var/ID) //A simple helper proc to find the name of a tech with a given ID. From 637f7193fc8561ac57bc3716c958a03005a2cc5b Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 22 May 2014 18:05:57 -0400 Subject: [PATCH 03/26] Fixes circuit var for other consoles Also cleans up attackby while we're at it. --- code/game/dna/dna_modifier.dm | 36 ++------------------ code/game/machinery/computer/aifixer.dm | 35 ++----------------- code/game/machinery/computer/arcade.dm | 21 ++---------- code/game/machinery/computer/pod.dm | 4 ++- code/game/supplyshuttle.dm | 30 +--------------- code/modules/mining/mine_items.dm | 24 ++----------- code/modules/power/turbine.dm | 3 ++ code/modules/reagents/Chemistry-Machinery.dm | 31 ++--------------- code/modules/research/research_shuttle.dm | 23 ++----------- code/modules/research/server.dm | 29 ++-------------- code/modules/virus2/curer.dm | 8 ++--- 11 files changed, 27 insertions(+), 217 deletions(-) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index eadbfb06e14..3306556a245 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -220,6 +220,7 @@ icon = 'icons/obj/computer.dmi' icon_state = "scanner" density = 1 + circuit = obj/item/weapon/circuitboard/scan_consolenew var/selected_ui_block = 1.0 var/selected_ui_subblock = 1.0 var/selected_se_block = 1.0 @@ -241,32 +242,6 @@ var/waiting_for_user_input=0 // Fix for #274 (Mash create block injector without answering dialog to make unlimited injectors) - N3X /obj/machinery/computer/scan_consolenew/attackby(obj/item/I as obj, mob/user as mob) - if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - new /obj/item/weapon/shard( src.loc ) - var/obj/item/weapon/circuitboard/scan_consolenew/M = new /obj/item/weapon/circuitboard/scan_consolenew( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.state = 3 - A.icon_state = "3" - A.anchored = 1 - del(src) - else - user << "\blue You disconnect the monitor." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/scan_consolenew/M = new /obj/item/weapon/circuitboard/scan_consolenew( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.state = 4 - A.icon_state = "4" - A.anchored = 1 - del(src) if (istype(I, /obj/item/weapon/disk/data)) //INSERT SOME diskS if (!src.disk) user.drop_item() @@ -276,7 +251,7 @@ nanomanager.update_uis(src) // update all UIs attached to src return else - src.attack_hand(user) + ..() return /obj/machinery/computer/scan_consolenew/ex_act(severity) @@ -339,13 +314,6 @@ I.buf = buffer return 1 -/obj/machinery/computer/scan_consolenew/attackby(obj/item/W as obj, mob/user as mob) - if ((istype(W, /obj/item/weapon/disk/data)) && (!src.disk)) - user.drop_item() - W.loc = src - src.disk = W - user << "You insert [W]." - nanomanager.update_uis(src) // update all UIs attached to src /* /obj/machinery/computer/scan_consolenew/process() //not really used right now if(stat & (NOPOWER|BROKEN)) diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 98548372af2..3048b644b43 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -2,6 +2,7 @@ name = "AI System Integrity Restorer" icon = 'icons/obj/computer.dmi' icon_state = "ai-fixer" + circuit = /obj/item/weapon/circuitboard/aifixer req_access = list(access_captain, access_robotics, access_heads) var/mob/living/silicon/ai/occupant = null var/active = 0 @@ -11,43 +12,13 @@ /obj/machinery/computer/aifixer/attackby(I as obj, user as mob) -/* - if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - new /obj/item/weapon/shard( src.loc ) - var/obj/item/weapon/circuitboard/robotics/M = new /obj/item/weapon/circuitboard/robotics( A ) - for (var/obj/C in src) - C.loc = src.loc - M.id = src.id - A.circuit = M - A.state = 3 - A.icon_state = "3" - A.anchored = 1 - del(src) - else - user << "\blue You disconnect the monitor." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/robotics/M = new /obj/item/weapon/circuitboard/robotics( A ) - for (var/obj/C in src) - C.loc = src.loc - M.id = src.id - A.circuit = M - A.state = 4 - A.icon_state = "4" - A.anchored = 1 - del(src) -*/ if(istype(I, /obj/item/device/aicard)) if(stat & (NOPOWER|BROKEN)) user << "This terminal isn't functioning right now, get it working!" return I:transfer_ai("AIFIXER","AICARD",src,user) - - //src.attack_hand(user) + + ..() return /obj/machinery/computer/aifixer/attack_ai(var/mob/user as mob) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index e5d4d3675a8..11bebd70b67 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -238,27 +238,10 @@ src.updateUsrDialog() - else if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/arcade/M = new /obj/item/weapon/circuitboard/arcade( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.anchored = 1 + else + ..() - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - new /obj/item/weapon/shard( src.loc ) - A.state = 3 - A.icon_state = "3" - else - user << "\blue You disconnect the monitor." - A.state = 4 - A.icon_state = "4" - del(src) /obj/machinery/computer/arcade/emp_act(severity) if(stat & (NOPOWER|BROKEN)) ..(severity) diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 0a5696ee4ce..d65b3b56398 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -4,6 +4,7 @@ name = "Pod Launch Control" desc = "A controll for launching pods. Some people prefer firing Mechas." icon_state = "computer_generic" + circuit = /obj/item/weapon/circuitboard/pod var/id = 1.0 var/obj/machinery/mass_driver/connected = null var/timing = 0.0 @@ -48,7 +49,7 @@ return return - +/* /obj/machinery/computer/pod/attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) @@ -103,6 +104,7 @@ else attack_hand(user) return +*/ /obj/machinery/computer/pod/attack_ai(var/mob/user as mob) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index f28b649ba75..6ec412033a7 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -497,36 +497,8 @@ var/list/mechtoys = list( user << "\blue Special supplies unlocked." hacked = 1 return - if(istype(I, /obj/item/weapon/screwdriver)) - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - if (stat & BROKEN) - user << "\blue The broken glass falls out." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc ) - new /obj/item/weapon/shard( loc ) - var/obj/item/weapon/circuitboard/supplycomp/M = new /obj/item/weapon/circuitboard/supplycomp( A ) - for (var/obj/C in src) - C.loc = loc - A.circuit = M - A.state = 3 - A.icon_state = "3" - A.anchored = 1 - del(src) - else - user << "\blue You disconnect the monitor." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc ) - var/obj/item/weapon/circuitboard/supplycomp/M = new /obj/item/weapon/circuitboard/supplycomp( A ) - if(can_order_contraband) - M.contraband_enabled = 1 - for (var/obj/C in src) - C.loc = loc - A.circuit = M - A.state = 4 - A.icon_state = "4" - A.anchored = 1 - del(src) else - attack_hand(user) + ..() return /obj/machinery/computer/supplycomp/Topic(href, href_list) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 14e07c3f8c7..81165e3035f 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -161,28 +161,8 @@ proc/move_mining_shuttle() src.req_access = list() hacked = 1 usr << "You fried the consoles ID checking system. It's now available to everyone!" - - else if(istype(W, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/mining_shuttle/M = new /obj/item/weapon/circuitboard/mining_shuttle( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.anchored = 1 - - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - new /obj/item/weapon/shard( src.loc ) - A.state = 3 - A.icon_state = "3" - else - user << "\blue You disconnect the monitor." - A.state = 4 - A.icon_state = "4" - - del(src) + else + ..() /******************************Lantern*******************************/ diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 82e05e954be..03afd0723f3 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -31,6 +31,7 @@ desc = "A computer to remotely control a gas turbine" icon = 'icons/obj/computer.dmi' icon_state = "airtunnel0e" + circuit = /obj/item/weapon/circuitboard/turbine_control anchored = 1 density = 1 var/obj/machinery/compressor/compressor @@ -220,6 +221,7 @@ if(P.id == id) doors += P +/* /obj/machinery/computer/turbine_computer/attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) @@ -252,6 +254,7 @@ else src.attack_hand(user) return +*/ /obj/machinery/computer/turbine_computer/attack_hand(var/mob/user as mob) user.machine = src diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index bf8e2338131..81222b82554 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -599,8 +599,9 @@ anchored = 1 icon = 'icons/obj/chemical.dmi' icon_state = "mixer0" - use_power = 1 - idle_power_usage = 20 + circuit = /obj/item/weapon/circuitboard/pandemic + //use_power = 1 + //idle_power_usage = 20 //defaults make more sense. var/temphtml = "" var/wait = null var/obj/item/weapon/reagent_containers/glass/beaker = null @@ -829,32 +830,6 @@ /obj/machinery/computer/pandemic/attackby(var/obj/I as obj, var/mob/user as mob) - if(istype(I, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - var/obj/structure/computerframe/A = new /obj/structure/computerframe(src.loc) - new /obj/item/weapon/shard(src.loc) - var/obj/item/weapon/circuitboard/pandemic/M = new /obj/item/weapon/circuitboard/pandemic(A) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.state = 3 - A.icon_state = "3" - A.anchored = 1 - del(src) - else - user << "\blue You disconnect the monitor." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/pandemic/M = new /obj/item/weapon/circuitboard/pandemic(A) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.state = 4 - A.icon_state = "4" - A.anchored = 1 - del(src) else if(istype(I, /obj/item/weapon/reagent_containers/glass)) if(stat & (NOPOWER|BROKEN)) return if(src.beaker) diff --git a/code/modules/research/research_shuttle.dm b/code/modules/research/research_shuttle.dm index 91c1464d36b..b0119b42aad 100644 --- a/code/modules/research/research_shuttle.dm +++ b/code/modules/research/research_shuttle.dm @@ -104,24 +104,5 @@ proc/move_research_shuttle() hacked = 1 usr << "You fried the consoles ID checking system. It's now available to everyone!" - else if(istype(W, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/research_shuttle/M = new /obj/item/weapon/circuitboard/research_shuttle( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.anchored = 1 - - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - new /obj/item/weapon/shard( src.loc ) - A.state = 3 - A.icon_state = "3" - else - user << "\blue You disconnect the monitor." - A.state = 4 - A.icon_state = "4" - - del(src) + else + ..() diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index ac9166602f1..1ff42aa0957 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -193,6 +193,7 @@ /obj/machinery/computer/rdservercontrol name = "R&D Server Controller" icon_state = "rdcomp" + circuit = /obj/item/weapon/circuitboard/rdservercontrol var/screen = 0 var/obj/machinery/r_n_d/server/temp_server var/list/servers = list() @@ -332,38 +333,12 @@ return /obj/machinery/computer/rdservercontrol/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) - if(istype(D, /obj/item/weapon/screwdriver)) - playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(do_after(user, 20)) - if (src.stat & BROKEN) - user << "\blue The broken glass falls out." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - new /obj/item/weapon/shard( src.loc ) - var/obj/item/weapon/circuitboard/rdservercontrol/M = new /obj/item/weapon/circuitboard/rdservercontrol( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.state = 3 - A.icon_state = "3" - A.anchored = 1 - del(src) - else - user << "\blue You disconnect the monitor." - var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc ) - var/obj/item/weapon/circuitboard/rdservercontrol/M = new /obj/item/weapon/circuitboard/rdservercontrol( A ) - for (var/obj/C in src) - C.loc = src.loc - A.circuit = M - A.state = 4 - A.icon_state = "4" - A.anchored = 1 - del(src) else if(istype(D, /obj/item/weapon/card/emag) && !emagged) playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) emagged = 1 user << "\blue You you disable the security protocols" src.updateUsrDialog() - return + return ..() /obj/machinery/r_n_d/server/robotics diff --git a/code/modules/virus2/curer.dm b/code/modules/virus2/curer.dm index 4d616048d18..44a0fd348b9 100644 --- a/code/modules/virus2/curer.dm +++ b/code/modules/virus2/curer.dm @@ -2,20 +2,20 @@ name = "Cure Research Machine" icon = 'icons/obj/computer.dmi' icon_state = "dna" + circuit = /obj/item/weapon/circuitboard/curefab var/curing var/virusing var/obj/item/weapon/reagent_containers/container = null /obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob) - if(istype(I, /obj/item/weapon/screwdriver)) - return ..(I,user) if(istype(I,/obj/item/weapon/reagent_containers)) var/mob/living/carbon/C = user if(!container) container = I C.drop_item() I.loc = src + return if(istype(I,/obj/item/weapon/virusdish)) if(virusing) user << "The pathogen materializer is still recharging.." @@ -31,8 +31,8 @@ state("The [src.name] Buzzes", "blue") return - src.attack_hand(user) - return + ..() + return /obj/machinery/computer/curer/attack_ai(var/mob/user as mob) return src.attack_hand(user) From 70333dfb51dc3a59a87c182e8f460c5581182ca0 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 22 May 2014 18:19:34 -0400 Subject: [PATCH 04/26] Setting RD board access now uses visible_message --- code/game/machinery/computer/buildandrepair.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 5772cd77565..77362e7aa17 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -277,7 +277,7 @@ /obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) if(istype(I,/obj/item/weapon/screwdriver)) - user << "\blue You adjust the jumper on the access protocol pins." + user.visible_message("\blue \the [user] adjusts the jumper on the [src]'s access protocol pins.", "\blue You adjust the jumper on the access protocol pins.") if(src.build_path == "/obj/machinery/computer/rdconsole/core") src.name = "Circuit Board (RD Console - Robotics)" src.build_path = "/obj/machinery/computer/rdconsole/robotics" From 296336e15eeac8eb449da8aeaa20789a05a8e762 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 22 May 2014 18:19:55 -0400 Subject: [PATCH 05/26] Small fixes --- code/game/dna/dna_modifier.dm | 2 +- code/modules/reagents/Chemistry-Machinery.dm | 2 +- code/modules/research/server.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 3306556a245..1edca25f8ed 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -220,7 +220,7 @@ icon = 'icons/obj/computer.dmi' icon_state = "scanner" density = 1 - circuit = obj/item/weapon/circuitboard/scan_consolenew + circuit = /obj/item/weapon/circuitboard/scan_consolenew var/selected_ui_block = 1.0 var/selected_ui_subblock = 1.0 var/selected_se_block = 1.0 diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 81222b82554..22031620ce2 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -830,7 +830,7 @@ /obj/machinery/computer/pandemic/attackby(var/obj/I as obj, var/mob/user as mob) - else if(istype(I, /obj/item/weapon/reagent_containers/glass)) + if(istype(I, /obj/item/weapon/reagent_containers/glass)) if(stat & (NOPOWER|BROKEN)) return if(src.beaker) user << "A beaker is already loaded into the machine." diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 1ff42aa0957..a22d6e03995 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -333,7 +333,7 @@ return /obj/machinery/computer/rdservercontrol/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob) - else if(istype(D, /obj/item/weapon/card/emag) && !emagged) + if(istype(D, /obj/item/weapon/card/emag) && !emagged) playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1) emagged = 1 user << "\blue You you disable the security protocols" From fa458a63ec4b912004e079e5be05d9afd496411b Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 24 May 2014 11:00:46 -0400 Subject: [PATCH 06/26] Fixes #5050 --- code/modules/clothing/clothing.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index da36e5544aa..9ff41b4ff7f 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -5,6 +5,10 @@ //BS12: Species-restricted clothing check. /obj/item/clothing/mob_can_equip(M as mob, slot) + //if we can equip the item anyway, don't bother with species_restricted (aslo cuts down on spam) + if (!..()) + return 0 + if(species_restricted && istype(M,/mob/living/carbon/human)) var/wearable = null @@ -26,7 +30,7 @@ M << "\red Your species cannot wear [src]." return 0 - return ..() + return 1 //Ears: headsets, earmuffs and tiny objects /obj/item/clothing/ears From 2c3ecc78d56c9372c1fdf1a6cf7a2d710c7f051d Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 24 May 2014 11:54:55 -0400 Subject: [PATCH 07/26] Fixes #4889 --- code/modules/admin/admin_verbs.dm | 32 +++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 77e45f2d679..3c31f443292 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -557,14 +557,42 @@ var/list/admin_verbs_mentor = list( /client/proc/give_disease(mob/T as mob in mob_list) // -- Giacom set category = "Fun" - set name = "Give Disease" - set desc = "Gives a Disease to a mob." + set name = "Give Disease (old)" + set desc = "Gives an (old-style) Disease to a mob." var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in diseases if(!D) return T.contract_disease(new D, 1) feedback_add_details("admin_verb","GD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] gave [key_name(T)] the disease [D].") message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] the disease [D].", 1) + +/client/proc/give_disease2(mob/T as mob in mob_list) // -- Giacom + set category = "Fun" + set name = "Give Disease" + set desc = "Gives a Disease to a mob." + + var/datum/disease2/disease/D = new /datum/disease2/disease() + + var/greater = ((input("Is this a lesser or greater disease?", "Give Disease") in list("Lesser", "Greater")) == "Greater") + + D.makerandom(greater) + if (!greater) + D.infectionchance = 1 + + D.infectionchance = input("How virulent is this disease? (1-100)", "Give Disease", D.infectionchance) as num + + if(istype(T,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = T + if (H.species) + D.affected_species = list(H.species.name) + if(istype(T,/mob/living/carbon/monkey)) + var/mob/living/carbon/monkey/M = T + D.affected_species = list(M.greaterform) + infect_virus2(T,D,1) + + feedback_add_details("admin_verb","GD2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + log_admin("[key_name(usr)] gave [key_name(T)] a [(greater)? "greater":"lesser"] disease2 with infection chance [D.infectionchance].") + message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] a [(greater)? "greater":"lesser"] disease2 with infection chance [D.infectionchance].", 1) /client/proc/make_sound(var/obj/O in world) // -- TLE set category = "Special Verbs" From d5b22e9125f30c89f1cfed23307285e321076966 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 24 May 2014 12:14:16 -0400 Subject: [PATCH 08/26] Forgot to add VV menu entry for give_disease2 --- code/datums/datumvars.dm | 14 +++++++++++++- code/modules/admin/admin_verbs.dm | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index b6e157c59b8..4c01933dbe6 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -245,7 +245,8 @@ client if(ismob(D)) body += "" - body += "" + body += "" + body += "" body += "" body += "" @@ -494,6 +495,17 @@ client src.give_disease(M) href_list["datumrefresh"] = href_list["give_spell"] + + else if(href_list["give_disease2"]) + if(!check_rights(R_ADMIN|R_FUN)) return + + var/mob/M = locate(href_list["give_disease2"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" + return + + src.give_disease2(M) + href_list["datumrefresh"] = href_list["give_spell"] else if(href_list["ninja"]) if(!check_rights(R_SPAWN)) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 3c31f443292..05afecb3a99 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -558,7 +558,7 @@ var/list/admin_verbs_mentor = list( /client/proc/give_disease(mob/T as mob in mob_list) // -- Giacom set category = "Fun" set name = "Give Disease (old)" - set desc = "Gives an (old-style) Disease to a mob." + set desc = "Gives a (tg-style) Disease to a mob." var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in diseases if(!D) return T.contract_disease(new D, 1) From d8645a59e894b533810a0e3993cfccda6fa550c9 Mon Sep 17 00:00:00 2001 From: Vivalas Date: Sat, 24 May 2014 19:56:35 -0500 Subject: [PATCH 09/26] Pod Launch Fix Fixed a derpy code error. --- code/game/machinery/computer/pod.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index d65b3b56398..f254c4eb4bf 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -34,7 +34,7 @@ for(var/obj/machinery/door/poddoor/M in world) if(M.id == id) M.open() - return + sleep(20) for(var/obj/machinery/mass_driver/M in world) @@ -173,6 +173,12 @@ connected.power = t if(href_list["alarm"]) alarm() + if(href_list["drive"]) + for(var/obj/machinery/mass_driver/M in world) + if(M.id == id) + M.power = connected.power + M.drive() + if(href_list["time"]) timing = text2num(href_list["time"]) if(href_list["tp"]) From dec86791dfc3a9fa1cc6490d6c3351b0707c8013 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Sun, 25 May 2014 13:10:44 +1200 Subject: [PATCH 10/26] Bot attack fix - Fixes bots attacking through windows --- code/game/machinery/bots/ed209bot.dm | 2 +- code/game/machinery/bots/medbot.dm | 2 +- code/game/machinery/bots/secbot.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 49c491b16ec..ab59cb97010 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -269,7 +269,7 @@ Auto Patrol: []"}, walk_to(src,0) if (target) // make sure target exists - if (get_dist(src, src.target) <= 1) // if right next to perp + if (Adjacent(target)) // if right next to perp playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) src.icon_state = "[lasercolor]ed209-c" spawn(2) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index 31fbb8c4679..a1d524a4802 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -284,7 +284,7 @@ continue - if(src.patient && (get_dist(src,src.patient) <= 1)) + if(src.patient && Adjacent(patient)) if(!src.currently_healing) src.currently_healing = 1 src.frustration = 0 diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index ee014dd6dfb..917d3993234 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -219,7 +219,7 @@ Auto Patrol: []"}, walk_to(src,0) if(target) // make sure target exists - if(get_dist(src, src.target) <= 1 && isturf(src.target.loc)) // if right next to perp + if(Adjacent(target)) // if right next to perp if(istype(src.target,/mob/living/carbon)) playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) src.icon_state = "secbot-c" From 57a5bf45de63d0d31aa113330ef4294c54a81a10 Mon Sep 17 00:00:00 2001 From: RavingManiac Date: Sun, 25 May 2014 16:49:24 +0800 Subject: [PATCH 11/26] Fixed inflatable barrier crates --- code/datums/supplypacks.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index 12941e7cc62..11eb36ffd1b 100755 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -179,7 +179,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee containername = "Emergency crate" group = "Engineering" -/datum/supply_packs/evacuation +/datum/supply_packs/inflatable name = "Inflatable barriers" contains = list(/obj/item/weapon/storage/briefcase/inflatable, /obj/item/weapon/storage/briefcase/inflatable, From a9d868a241b822e547ef9928fb1900c931f0d1a0 Mon Sep 17 00:00:00 2001 From: Vivalas Date: Sun, 25 May 2014 14:59:25 -0500 Subject: [PATCH 12/26] Update pod.dm --- code/game/machinery/computer/pod.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index f254c4eb4bf..eeadf4de4c3 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -174,7 +174,7 @@ if(href_list["alarm"]) alarm() if(href_list["drive"]) - for(var/obj/machinery/mass_driver/M in world) + for(var/obj/machinery/mass_driver/M in machines) if(M.id == id) M.power = connected.power M.drive() From bb3d947b6411d01a8d558d37161b1ae1077d2696 Mon Sep 17 00:00:00 2001 From: ZekeSulastin Date: Sun, 25 May 2014 17:56:08 -0400 Subject: [PATCH 13/26] Adds languages to DNA2 cloning records --- code/game/dna/dna_modifier.dm | 1 + code/game/machinery/computer/cloning.dm | 1 + 2 files changed, 2 insertions(+) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index eadbfb06e14..e0de636ff30 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -16,6 +16,7 @@ var/implant=null var/ckey=null var/mind=null + var/languages=null /datum/dna2/record/proc/GetData() var/list/ser=list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 293046b0768..9ce8ccb4fc6 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -361,6 +361,7 @@ R.id= copytext(md5(subject.real_name), 2, 6) R.name=R.dna.real_name R.types=DNA2_BUF_UI|DNA2_BUF_UE|DNA2_BUF_SE + R.languages=subject.languages //Add an implant if needed var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject) From e03b0bc316ce7a121bbd09db33156eaa73fb9051 Mon Sep 17 00:00:00 2001 From: ZekeSulastin Date: Sun, 25 May 2014 17:56:39 -0400 Subject: [PATCH 14/26] Uncomments application of languages to clone --- code/game/machinery/cloning.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 15d0b2d61c4..cdb2063d872 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -214,8 +214,8 @@ H.set_species(R.dna.species) - //for(var/datum/language/L in languages) - // H.add_language(L.name) + for(var/datum/language/L in R.languages) + H.add_language(L.name) H.suiciding = 0 src.attempting = 0 return 1 From fb4f97011327eaac99acba63a5fcbfbd73ab5a8a Mon Sep 17 00:00:00 2001 From: Walter0o Date: Mon, 26 May 2014 01:32:07 +0200 Subject: [PATCH 15/26] exploit fix, electric boogaloo : canister edition https://github.com/Baystation12/Baystation12/commit/024a0baa49df0cb1ec8af4967fefe9d5575453eb removed the exploit protection of canisters without replacement, this commit fixes that. without this, anybody can open/close valves and all other forms of messing with any canister from anywhere. ALWAYS keep in mind, NanoUI will update the fancy buttons CLIENTSIDE, that does NOT protect against exploits ! the actual buttonpush can still be spoofed to the server even if NanoUI disabled/hid/greyed-out/removed the button ! --- code/game/machinery/atmoalter/canister.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 7cdfe57af3a..0876c56f718 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -275,10 +275,15 @@ update_flag /obj/machinery/portable_atmospherics/canister/Topic(href, href_list) - //Do not use "if(..()) return" here, canisters will stop working in unpowered areas like space or on the derelict. + //Do not use "if(..()) return" here, canisters will stop working in unpowered areas like space or on the derelict. // yeah but without SOME sort of Topic check any dick can mess with them via exploits as he pleases -walter0o if (!istype(src.loc, /turf)) return 0 - + + if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) // exploit protection -walter0o + usr << browse(null, "window=canister") + onclose(usr, "canister") + return + if(href_list["toggle"]) if (valve_open) if (holding) From 7c7df8b4e251a931af816df3c17e443a25db7ec3 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 26 May 2014 17:16:58 -0400 Subject: [PATCH 16/26] Fixes #5018 --- code/modules/supermatter/supermatter.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index 3fc7e7d9a75..118c1e8181b 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -188,7 +188,7 @@ if(!istype(l.glasses, /obj/item/clothing/glasses/meson)) l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) ) - for(var/mob/living/l in range(src, round((power / 100) ** 0.25))) + for(var/mob/living/l in range(src, 8)) var/rads = (power / 10) * sqrt( 1 / get_dist(l, src) ) l.apply_effect(rads, IRRADIATE) From f9e23cb39b43ef46b9d4ea48bc7d60e615c4010d Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Tue, 27 May 2014 03:58:36 -0500 Subject: [PATCH 17/26] Beepsky will no longer attack monkeys while doing weapons authorization checks. I'd say it's a holdover from monkey epidemic but the truth is this is cael code that is being changed, it's been that way for over a year and I still can't rap my head around why these lines were put in. --- code/game/machinery/bots/secbot.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 917d3993234..784011e4d97 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -600,8 +600,6 @@ Auto Patrol: []"}, if(istype(C, /mob/living/carbon/human)) src.threatlevel = src.assess_perp(C) - else if((src.idcheck) && (istype(C, /mob/living/carbon/monkey))) - src.threatlevel = 4 else if(istype(M, /mob/living/simple_animal/hostile)) if(M.stat == DEAD) From a29861480a77bb862953cf5ed15c05724f75b3da Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 28 May 2014 16:35:06 +0930 Subject: [PATCH 18/26] Fixes #5023 --- code/game/objects/items/toys.dm | 12 +++++++++++- code/game/objects/items/weapons/storage/belt.dm | 6 ------ maps/tgstation2.dmm | 6 +++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index b7c0cef238d..852072769a6 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -585,4 +585,14 @@ force = 5 w_class = 4.0 slot_flags = SLOT_BACK -*/ \ No newline at end of file +*/ + +//This should really be somewhere else but I don't know where. w/e +/obj/item/weapon/inflatable_duck + name = "inflatable duck" + desc = "No bother to sink or swim when you can just float!" + icon_state = "inflatable" + item_state = "inflatable" + flags = FPRINT | TABLEPASS + icon = 'icons/obj/clothing/belts.dmi' + slot_flags = SLOT_BELT \ No newline at end of file diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 8bdae5d8532..06a94d0af6b 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -157,12 +157,6 @@ "/obj/item/clothing/mask/luchador" ) -/obj/item/weapon/storage/belt/inflatable - name = "inflatable duck" - desc = "No bother to sink or swim when you can just float!" - icon_state = "inflatable" - item_state = "inflatable" - /obj/item/weapon/storage/belt/security/tactical name = "combat belt" desc = "Can hold security gear like handcuffs and flashes, with more pouches for more storage." diff --git a/maps/tgstation2.dmm b/maps/tgstation2.dmm index 706758221c1..69fdec8200e 100644 --- a/maps/tgstation2.dmm +++ b/maps/tgstation2.dmm @@ -6665,7 +6665,7 @@ "cyi" = (/turf/simulated/floor/holofloor{dir = 10; icon_state = "red"},/area/holodeck/source_basketball) "cyj" = (/turf/simulated/floor/holofloor{dir = 2; icon_state = "red"},/area/holodeck/source_basketball) "cyk" = (/turf/simulated/floor/holofloor{dir = 6; icon_state = "red"},/area/holodeck/source_basketball) -"cyl" = (/obj/item/weapon/storage/belt/inflatable,/turf/simulated/floor/beach/sand{tag = "icon-desert1"; icon_state = "desert1"},/area/holodeck/source_beach) +"cyl" = (/obj/item/inflatable,/turf/simulated/floor/beach/sand{tag = "icon-desert1"; icon_state = "desert1"},/area/holodeck/source_beach) "cym" = (/obj/structure/holowindow,/turf/simulated/floor/holofloor{dir = 8; icon_state = "red"},/area/holodeck/source_thunderdomecourt) "cyn" = (/obj/structure/holowindow,/turf/simulated/floor/holofloor,/area/holodeck/source_thunderdomecourt) "cyo" = (/obj/structure/holowindow,/turf/simulated/floor/holofloor{dir = 4; icon_state = "red"},/area/holodeck/source_thunderdomecourt) @@ -7626,7 +7626,7 @@ "cQH" = (/obj/machinery/door/airlock/hatch{icon_state = "door_locked"; locked = 1},/obj/machinery/atmospherics/pipe/simple/visible/yellow,/turf/simulated/floor/plating,/area/engine/engine_room) "cQI" = (/turf/unsimulated/floor{dir = 8; icon_state = "whitegreen"},/area/centcom/holding) "cQJ" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/poddoor{icon_state = "pdoor1"; id = "EngineEmitter"; layer = 3.3; name = "Engine Blast Doors"},/turf/simulated/floor/plating,/area/engine/engine_room) -"cQK" = (/turf/unsimulated/beach/sand{tag = "icon-desert"; icon_state = "desert"},/obj/item/weapon/storage/belt/inflatable,/turf/unsimulated/floor{tag = "icon-siding4"; name = "plating"; icon_state = "siding4"},/area/centcom/holding) +"cQK" = (/turf/unsimulated/beach/sand{tag = "icon-desert"; icon_state = "desert"},/obj/item/inflatable,/turf/unsimulated/floor{tag = "icon-siding4"; name = "plating"; icon_state = "siding4"},/area/centcom/holding) "cQL" = (/turf/unsimulated/floor{tag = "icon-wood"; icon_state = "wood"},/turf/unsimulated/floor{tag = "icon-siding8"; name = "plating"; icon_state = "siding8"},/area/centcom/holding) "cQM" = (/obj/structure/stool/bed/chair{dir = 1},/turf/simulated/shuttle/floor4,/area/shuttle/escape/centcom) "cQN" = (/obj/machinery/door/airlock/hatch{icon_state = "door_locked"; locked = 1},/obj/machinery/atmospherics/pipe/simple/visible/cyan,/turf/simulated/floor/plating,/area/engine/engine_room) @@ -7686,7 +7686,7 @@ "cRP" = (/obj/structure/stool/bed/chair,/turf/simulated/shuttle/floor4,/area/shuttle/escape/centcom) "cRQ" = (/obj/machinery/power/smes,/turf/simulated/floor/plating,/area/engine/engine_room) "cRR" = (/obj/machinery/vending/wallmed1{name = "Emergency NanoMed"; pixel_x = 0; pixel_y = 29; req_access_txt = "0"},/turf/unsimulated/floor{dir = 4; icon_state = "whitegreencorner"},/area/centcom/holding) -"cRS" = (/obj/item/weapon/storage/belt/inflatable,/turf/unsimulated/beach/sand{tag = "icon-desert"; icon_state = "desert"},/area/centcom/ferry) +"cRS" = (/obj/item/inflatable,/turf/unsimulated/beach/sand{tag = "icon-desert"; icon_state = "desert"},/area/centcom/ferry) "cRT" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 5; health = 1e+007},/turf/unsimulated/floor{name = "plating"},/area/tdome) "cRU" = (/obj/structure/table/woodentable{dir = 5},/obj/item/weapon/reagent_containers/food/drinks/drinkingglass,/turf/unsimulated/floor{icon_state = "grimy"},/area/centcom/holding) "cRV" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 5; health = 1e+007},/turf/unsimulated/floor{name = "plating"},/area/centcom/evac) From c2b97b7fcba92179017ab16355d193444e8a988a Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 28 May 2014 16:41:54 +0930 Subject: [PATCH 19/26] Fixes #4643 --- code/modules/mob/living/simple_animal/hostile/mimic.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index fb1d63ca348..bf02fadbfb0 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -127,7 +127,7 @@ // Copy Mimic // -var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/cable, /obj/structure/window) +var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/cable, /obj/structure/window, /obj/item/projectile/animate) /mob/living/simple_animal/hostile/mimic/copy From d9f728cff5160dcd2e66f40a381f76d4799a75ed Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 28 May 2014 16:57:15 +0930 Subject: [PATCH 20/26] Fixes #5061 --- code/WorkInProgress/kilakk/fax.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/WorkInProgress/kilakk/fax.dm b/code/WorkInProgress/kilakk/fax.dm index 0d8f4cdde1f..2934d2ed746 100644 --- a/code/WorkInProgress/kilakk/fax.dm +++ b/code/WorkInProgress/kilakk/fax.dm @@ -136,7 +136,9 @@ var/list/alldepartments = list("Central Command") authenticated = 0 if(href_list["dept"]) + var/lastdpt = dpt dpt = input(usr, "Which department?", "Choose a department", "") as null|anything in alldepartments + if(!dpt) dpt = lastdpt if(href_list["auth"]) if ( (!( authenticated ) && (scan)) ) From d4c9bf19856cde4fd29a7846feb17c2331e15a6a Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 28 May 2014 16:57:30 +0930 Subject: [PATCH 21/26] Fixes #5035 --- code/game/machinery/bots/ed209bot.dm | 2 +- code/game/machinery/bots/medbot.dm | 2 +- code/game/machinery/bots/secbot.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index ab59cb97010..4893bf47c20 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -731,7 +731,7 @@ Auto Patrol: []"}, /obj/machinery/bot/ed209/Bump(M as mob|obj) //Leave no door unopened! if ((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) var/obj/machinery/door/D = M - if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) + if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard) && !istype(D,/obj/machinery/door/poddoor)) D.open() src.frustration = 0 else if ((istype(M, /mob/living/)) && (!src.anchored)) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index a1d524a4802..1054f3c3582 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -480,7 +480,7 @@ /obj/machinery/bot/medbot/Bump(M as mob|obj) //Leave no door unopened! if ((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) var/obj/machinery/door/D = M - if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) + if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard) && !istype(D,/obj/machinery/door/poddoor)) D.open() src.frustration = 0 else if ((istype(M, /mob/living/)) && (!src.anchored)) diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 784011e4d97..06efb4673cf 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -680,7 +680,7 @@ Auto Patrol: []"}, /obj/machinery/bot/secbot/Bump(M as mob|obj) //Leave no door unopened! if((istype(M, /obj/machinery/door)) && (!isnull(src.botcard))) var/obj/machinery/door/D = M - if(!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard)) + if(!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard) && !istype(D,/obj/machinery/door/poddoor)) D.open() src.frustration = 0 else if((istype(M, /mob/living/)) && (!src.anchored)) From 8f50fbcd3bd89a8e69cb68eaa476cc599398434a Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 28 May 2014 17:00:31 +0930 Subject: [PATCH 22/26] Fixes #4940 --- code/modules/mob/living/simple_animal/friendly/spiderbot.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 71e38d0ba55..4f50ef31e45 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -19,6 +19,8 @@ icon_state = "spiderbot-chassis" icon_living = "spiderbot-chassis" icon_dead = "spiderbot-smashed" + universal_speak = 1 //Temp until these are rewritten. + wander = 0 health = 10 @@ -33,9 +35,8 @@ response_disarm = "shoos" response_harm = "stomps on" + var/emagged = 0 var/obj/item/held_item = null //Storage for single item they can hold. - var/emagged = 0 //IS WE EXPLODEN? - var/syndie = 0 //IS WE SYNDICAT? (currently unused) speed = -1 //Spiderbots gotta go fast. //pass_flags = PASSTABLE //Maybe griefy? small = 1 From 47a7617edd8bfc933b32a8a68829e8a8f6d85972 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 28 May 2014 11:27:21 -0400 Subject: [PATCH 23/26] Inaprovaline no longer a substitute for breathing --- code/modules/mob/living/carbon/human/life.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index cfcc611f192..907d6043c72 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -308,9 +308,11 @@ var/datum/gas_mixture/environment = loc.return_air() var/datum/gas_mixture/breath + // HACK NEED CHANGING LATER - if(health < config.health_threshold_crit) + if(health < config.health_threshold_crit && !reagents.has_reagent("inaprovaline")) losebreath++ + if(losebreath>0) //Suffocating so do not take a breath losebreath-- if (prob(10)) //Gasp per 10 ticks? Sounds about right. @@ -418,8 +420,6 @@ return if(!breath || (breath.total_moles() == 0) || suiciding) - if(reagents.has_reagent("inaprovaline")) - return if(suiciding) adjustOxyLoss(2)//If you are suiciding, you should die a little bit faster failed_last_breath = 1 From c9ec1fc00152dc10c830494d805cca15536fd4ca Mon Sep 17 00:00:00 2001 From: Walter0o Date: Wed, 28 May 2014 22:05:29 +0200 Subject: [PATCH 24/26] fixes exploits with the mech fabricator (bay12) this exploit is in all public builds i could look at. using the mech fabricator, and you were able to duplicate any obj in the server. as a nice bonus you could also abuse the part-description-function to identify any atom in the server memory for even easier access to other yet unknown exploits of this kind. and also range check was missing to make sure you are not on some other z level massproducing guns. i will not go into details, as it is exactly the same kind of exploit over and over, so if you are interested on how and why these exploits work, see some of my other exploit commits : https://github.com/Baystation12/Baystation12/pull/5068 https://github.com/Baystation12/Baystation12/pull/4750 i advise any coder team to be supercautious when changing/writing new Topic procs to prevent these, and to always doublecheck other coder's works. --- code/game/mecha/mech_fabricator.dm | 47 +++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index f15ae7eb48c..2af96aeeace 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -362,6 +362,11 @@ /obj/machinery/mecha_part_fabricator/proc/build_part(var/obj/item/part) if(!part) return + + // critical exploit prevention, do not remove unless you replace it -walter0o + if( !(locate(part, src.contents)) || !(part.vars.Find("construction_time")) || !(part.vars.Find("construction_cost")) ) // these 3 are the current requirements for an object being buildable by the mech_fabricator + return + src.being_built = new part.type(src) src.desc = "It's building [src.being_built]." src.remove_resources(part) @@ -603,9 +608,26 @@ onclose(user, "mecha_fabricator") return +/obj/machinery/mecha_part_fabricator/proc/exploit_prevention(var/obj/Part, mob/user as mob, var/desc_exploit) +// critical exploit prevention, feel free to improve or replace this, but do not remove it -walter0o + + if(!Part || !user || !istype(Part) || !istype(user)) // sanity + return 1 + + if( !(locate(Part, src.contents)) || !(Part.vars.Find("construction_time")) || !(Part.vars.Find("construction_cost")) ) // these 3 are the current requirements for an object being buildable by the mech_fabricator + + var/turf/LOC = get_turf(user) + message_admins("[key_name_admin(user)] tried to exploit an Exosuit Fabricator to [desc_exploit ? "get the desc of" : "duplicate"] [Part] ! ([LOC ? "JMP" : "null"])", 0) + log_admin("EXPLOIT : [key_name(user)] tried to exploit an Exosuit Fabricator to [desc_exploit ? "get the desc of" : "duplicate"] [Part] !") + return 1 + + return null /obj/machinery/mecha_part_fabricator/Topic(href, href_list) - ..() + + if(..()) // critical exploit prevention, do not remove unless you replace it -walter0o + return + var/datum/topic_input/filter = new /datum/topic_input(href,href_list) if(href_list["part_set"]) var/tpart_set = filter.getStr("part_set") @@ -616,13 +638,25 @@ src.part_set = tpart_set screen = "parts" if(href_list["part"]) - var/list/part = filter.getObj("part") + var/obj/part = filter.getObj("part") + + // critical exploit prevention, do not remove unless you replace it -walter0o + if(src.exploit_prevention(part, usr)) + return + if(!processing_queue) build_part(part) else add_to_queue(part) if(href_list["add_to_queue"]) - add_to_queue(filter.getObj("add_to_queue")) + var/obj/part = filter.getObj("add_to_queue") + + // critical exploit prevention, do not remove unless you replace it -walter0o + if(src.exploit_prevention(part, usr)) + return + + add_to_queue(part) + return update_queue_on_page() if(href_list["remove_from_queue"]) remove_from_queue(filter.getNum("remove_from_queue")) @@ -661,7 +695,12 @@ return update_queue_on_page() if(href_list["part_desc"]) var/obj/part = filter.getObj("part_desc") - if(part) + + // critical exploit prevention, do not remove unless you replace it -walter0o + if(src.exploit_prevention(part, usr, 1)) + return + + if(part) temp = {"

[part] description:

[part.desc]
Return From 2b372962c815e8215cfbb3ca6731ea9625ec937d Mon Sep 17 00:00:00 2001 From: Walter0o Date: Thu, 29 May 2014 19:02:17 +0200 Subject: [PATCH 25/26] alien weeds performance and layer fixes recently i fixed a couple of issues with /vg/'s alien weeds and nodes, and i see some applying to Bay12 too. one of those issues was the order of checks in weeds/Life(). it should cancel the weed's search for tiles to expand to without starting the direction loop first, saving quite a few proc calls. another issue is alien weeds having the default OBJ_LAYER layer 3 which makes them grow over all kinds of items and objects which makes sense i guess fluffwise but is really annoying ingame for both crew and aliens. ( and this coming from the host of Alium Deathtrap 13 ;) ) nodes stay at layer 3 to appear properly over things like AI-holopads. a really tiny improvement is setting linked_node after the space-turf check in weeds/New(). link to the /vg/ commit : https://github.com/d3athrow/vgstation13/commit/4dcb434f7258fe2acd266a1709ab2022389eb845 --- code/game/objects/effects/aliens.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 1e762e68b3f..da510025e35 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -184,6 +184,7 @@ anchored = 1 density = 0 + layer = 2 var/health = 15 var/obj/effect/alien/weeds/node/linked_node = null @@ -191,6 +192,7 @@ icon_state = "weednode" name = "purple sac" desc = "Weird purple octopus-like thing." + layer = 3 luminosity = NODERANGE var/node_range = NODERANGE @@ -200,10 +202,10 @@ /obj/effect/alien/weeds/New(pos, node) ..() - linked_node = node if(istype(loc, /turf/space)) del(src) return + linked_node = node if(icon_state == "weeds")icon_state = pick("weeds", "weeds1", "weeds2") spawn(rand(150, 200)) if(src) @@ -230,6 +232,9 @@ Alien plants should do something if theres a lot of poison del(src) return + if(!linked_node || (get_dist(linked_node, src) > linked_node.node_range) ) + return + direction_loop: for(var/dirn in cardinal) var/turf/T = get_step(src, dirn) @@ -237,9 +242,6 @@ Alien plants should do something if theres a lot of poison if (!istype(T) || T.density || locate(/obj/effect/alien/weeds) in T || istype(T.loc, /area/arrival) || istype(T, /turf/space)) continue - if(!linked_node || get_dist(linked_node, src) > linked_node.node_range) - return - // if (locate(/obj/movable, T)) // don't propogate into movables // continue From fd78c58f46225c3531231fdf9cf32af8370157d6 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Thu, 29 May 2014 21:36:34 -0500 Subject: [PATCH 26/26] Bot down? Let's not lock up the entire server. Instead we'll spawn a thread to handle it, not like we care what is returned either way. --- code/modules/ext_scripts/irc.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/ext_scripts/irc.dm b/code/modules/ext_scripts/irc.dm index e1456176903..8006652139e 100644 --- a/code/modules/ext_scripts/irc.dm +++ b/code/modules/ext_scripts/irc.dm @@ -7,9 +7,11 @@ else nudge_lib = "lib/nudge.so" - call(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[msg]") + spawn(0) + call(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[msg]") else - ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]") + spawn(0) + ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]") return /proc/send2mainirc(var/msg)