From aa9141fb75c5ee0bf4d93b7234bd5105aae9e9ea Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Mon, 3 Mar 2014 22:50:24 -0600 Subject: [PATCH 1/9] NanoUI Optimizations. We won't regenerate the list for Manifests every tick while viewing the manifest, instead we have a global variable for it PDA_Manifest that we Cut() if there is a change to the manifest then when the next player goes to view the manifest on their PDA it will recreate the list that one time. Some sections of the PDA will no longer auto-refresh every tick because...well that's dumb. Modes that will no longer autoupdate at all: Viewing medical/sec records, viewing notes (will update when you change them of course), and the station alert menu. Modes that will only autoupdate every 5 ticks: APC list (Because it's a huge fuck off list), the manifest, mulebots and secbots screens, supply requests/orders, and janitor supply locator) Some other things that I just can't remember right now. --- code/datums/datacore.dm | 7 +- code/defines/obj.dm | 13 ++- code/game/machinery/computer/skills.dm | 11 ++- code/game/machinery/cryopod.dm | 3 + code/game/objects/items/devices/PDA/PDA.dm | 85 ++++++++++++------- code/modules/mob/living/carbon/human/human.dm | 2 + 6 files changed, 86 insertions(+), 35 deletions(-) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index d4e9258422..a18849d81e 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -11,6 +11,8 @@ return /obj/effect/datacore/proc/manifest_modify(var/name, var/assignment) + if(PDA_Manifest.len) + PDA_Manifest.Cut() var/datum/data/record/foundrecord var/real_title = assignment @@ -34,6 +36,9 @@ foundrecord.fields["real_rank"] = real_title /obj/effect/datacore/proc/manifest_inject(var/mob/living/carbon/human/H) + if(PDA_Manifest.len) + PDA_Manifest.Cut() + if(H.mind && (H.mind.assigned_role != "MODE")) var/assignment if(H.mind.role_alt_title) @@ -269,4 +274,4 @@ proc/get_id_photo(var/mob/living/carbon/human/H) del(eyes_s) del(clothes_s) - return preview_icon \ No newline at end of file + return preview_icon diff --git a/code/defines/obj.dm b/code/defines/obj.dm index f307edd96f..197e3433d7 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -51,6 +51,8 @@ //This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). var/locked[] = list() + + /obj/effect/datacore/proc/get_manifest(monochrome, OOC) var/list/heads = new() var/list/sec = new() @@ -165,9 +167,16 @@ /* We can't just insert in HTML into the nanoUI so we need the raw data to play with. +Instead of creating this list over and over when someone leaves their PDA open to the page +we'll only update it when it changes. The PDA_Manifest global list is zeroed out upon any change +using /obj/effect/datacore/proc/manifest_inject( ), or manifest_insert( ) */ +var/global/list/PDA_Manifest = list() + /obj/effect/datacore/proc/get_manifest_json() + if(PDA_Manifest.len) + return PDA_Manifest var/heads[0] var/sec[0] var/eng[0] @@ -227,7 +236,8 @@ We can't just insert in HTML into the nanoUI so we need the raw data to play wit if(!department && !(name in heads)) misc[++misc.len] = list("name" = name, "rank" = rank, "active" = isactive) - return list(\ + + PDA_Manifest = list(\ "heads" = heads,\ "sec" = sec,\ "eng" = eng,\ @@ -237,6 +247,7 @@ We can't just insert in HTML into the nanoUI so we need the raw data to play wit "bot" = bot,\ "misc" = misc\ ) + return PDA_Manifest diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 7613d711ce..0327bb04df 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -289,6 +289,8 @@ What a mess.*/ temp += "No" if ("Purge All Records") + if(PDA_Manifest.len) + PDA_Manifest.Cut() for(var/datum/data/record/R in data_core.security) del(R) temp = "All Employment records deleted." @@ -300,6 +302,9 @@ What a mess.*/ temp += "No" //RECORD CREATE if ("New Record (General)") + + if(PDA_Manifest.len) + PDA_Manifest.Cut() var/datum/data/record/G = new /datum/data/record() G.fields["name"] = "New Record" G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6)) @@ -372,12 +377,16 @@ What a mess.*/ switch(href_list["choice"]) if ("Change Rank") if (active1) + if(PDA_Manifest.len) + PDA_Manifest.Cut() active1.fields["rank"] = href_list["rank"] if(href_list["rank"] in get_all_jobs()) active1.fields["real_rank"] = href_list["real_rank"] if ("Delete Record (ALL) Execute") if (active1) + if(PDA_Manifest.len) + PDA_Manifest.Cut() for(var/datum/data/record/R in data_core.medical) if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"])) del(R) @@ -416,4 +425,4 @@ What a mess.*/ del(R) continue - ..(severity) \ No newline at end of file + ..(severity) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 3a0de6a800..8005ea71a8 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -240,6 +240,9 @@ obj/machinery/computer/cryopod/Topic(href, href_list) current_mode.possible_traitors.Remove(occupant) // Delete them from datacore. + + if(PDA_Manifest.len) + PDA_Manifest.Cut() for(var/datum/data/record/R in data_core.medical) if ((R.fields["name"] == occupant.real_name)) del(R) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 87f0e20735..ec1e6195d2 100755 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -20,6 +20,9 @@ var/global/list/obj/item/device/pda/PDAs = list() var/obj/item/weapon/cartridge/cartridge = null //current cartridge var/mode = 0 //Controls what menu the PDA will display. 0 is hub; the rest are either built in or based on cartridge. + var/lastmode = 0 + var/ui_tick = 0 + //Secondary variables var/scanmode = 0 //1 is medical scanner, 2 is forensics, 3 is reagent scanner. var/fon = 0 //Is the flashlight function on? @@ -42,6 +45,10 @@ var/global/list/obj/item/device/pda/PDAs = list() var/list/conversations = list() // For keeping up with who we have PDA messsages from. var/newmessage = 0 //To remove hackish overlay check + var/list/cartmodes = list(40, 42, 43, 433, 44, 441, 45, 451, 46, 48, 47, 49) // If you add more cartridge modes add them to this list as well. + var/list/no_auto_update = list(1, 40, 43, 44, 441, 45, 451) // These modes we turn off autoupdate + var/list/update_every_five = list(3, 41, 433, 46, 47, 48, 49) // These we update every 5 ticks + var/obj/item/weapon/card/id/id = null //Making it possible to slot an ID card into the PDA so it can function as both. var/ownjob = null //related to above @@ -287,6 +294,7 @@ var/global/list/obj/item/device/pda/PDAs = list() /obj/item/device/pda/New() ..() PDAs += src + PDAs = sortAtom(PDAs) if(default_cartridge) cartridge = new default_cartridge(src) new /obj/item/weapon/pen(src) @@ -319,7 +327,17 @@ var/global/list/obj/item/device/pda/PDAs = list() return attack_self(M) return + /obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) + ui_tick++ + var/auto_update = 1 + if(mode in no_auto_update) + auto_update = 0 + if(mode == lastmode && ui_tick % 5 && mode in update_every_five) + return + + lastmode = mode + var/title = "Personal Data Assistant" var/data[0] // This is the data that will be sent to the PDA @@ -345,35 +363,38 @@ var/global/list/obj/item/device/pda/PDAs = list() if(cartridge) var/cartdata[0] - data["records"] = cartridge.create_NanoUI_values() + if(mode in cartmodes) + data["records"] = cartridge.create_NanoUI_values() - cartdata["name"] = cartridge.name - cartdata["access"] = list(\ - "access_security" = cartridge.access_security,\ - "access_engine" = cartridge.access_engine,\ - "access_atmos" = cartridge.access_atmos,\ - "access_medical" = cartridge.access_medical,\ - "access_clown" = cartridge.access_clown,\ - "access_mime" = cartridge.access_mime,\ - "access_janitor" = cartridge.access_janitor,\ - "access_quartermaster" = cartridge.access_quartermaster,\ - "access_hydroponics" = cartridge.access_hydroponics,\ - "access_reagent_scanner" = cartridge.access_reagent_scanner,\ - "access_remote_door" = cartridge.access_remote_door,\ - "access_status_display" = cartridge.access_status_display\ - ) - if(isnull(cartridge.radio)) - cartdata["radio"] = 0 - else - if(istype(cartridge.radio, /obj/item/radio/integrated/beepsky)) - cartdata["radio"] = 1 - if(istype(cartridge.radio, /obj/item/radio/integrated/signal)) - cartdata["radio"] = 2 - if(istype(cartridge.radio, /obj/item/radio/integrated/mule)) - cartdata["radio"] = 3 + if(mode == 0) + cartdata["name"] = cartridge.name + cartdata["access"] = list(\ + "access_security" = cartridge.access_security,\ + "access_engine" = cartridge.access_engine,\ + "access_atmos" = cartridge.access_atmos,\ + "access_medical" = cartridge.access_medical,\ + "access_clown" = cartridge.access_clown,\ + "access_mime" = cartridge.access_mime,\ + "access_janitor" = cartridge.access_janitor,\ + "access_quartermaster" = cartridge.access_quartermaster,\ + "access_hydroponics" = cartridge.access_hydroponics,\ + "access_reagent_scanner" = cartridge.access_reagent_scanner,\ + "access_remote_door" = cartridge.access_remote_door,\ + "access_status_display" = cartridge.access_status_display\ + ) + if(isnull(cartridge.radio)) + cartdata["radio"] = 0 + else + if(istype(cartridge.radio, /obj/item/radio/integrated/beepsky)) + cartdata["radio"] = 1 + if(istype(cartridge.radio, /obj/item/radio/integrated/signal)) + cartdata["radio"] = 2 + if(istype(cartridge.radio, /obj/item/radio/integrated/mule)) + cartdata["radio"] = 3 - cartdata["type"] = cartridge.type - cartdata["charges"] = cartridge.charges ? cartridge.charges : 0 + if(mode == 2) + cartdata["type"] = cartridge.type + cartdata["charges"] = cartridge.charges ? cartridge.charges : 0 data["cartridge"] = cartdata data["stationTime"] = worldtime2text() @@ -383,7 +404,7 @@ var/global/list/obj/item/device/pda/PDAs = list() var/convopdas[0] var/pdas[0] var/count = 0 - for (var/obj/item/device/pda/P in sortAtom(PDAs)) + for (var/obj/item/device/pda/P in PDAs) if (!P.owner||P.toff||P == src||P.hidden) continue if(conversations.Find("\ref[P]")) convopdas.Add(list(list("Name" = "[P]", "Reference" = "\ref[P]", "Detonate" = "[P.detonate]", "inconvo" = "1"))) @@ -413,8 +434,8 @@ var/global/list/obj/item/device/pda/PDAs = list() if(mode==3) - var/turf/T = get_turf_or_move(user.loc) - if(!isnull(T) || mode!=3) + var/turf/T = get_turf(user.loc) + if(!isnull(T)) var/datum/gas_mixture/environment = T.return_air() var/pressure = environment.return_pressure() @@ -449,8 +470,8 @@ var/global/list/obj/item/device/pda/PDAs = list() ui.set_initial_data(data) // open the new ui window ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + // auto update every Master Controller tick + ui.set_auto_update(auto_update) //NOTE: graphic resources are loaded on client login /obj/item/device/pda/attack_self(mob/user as mob) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7dc0594a8f..5fafe98658 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -676,6 +676,8 @@ if(setmedical != "Cancel") R.fields["p_stat"] = setmedical modified = 1 + if(PDA_Manifest.len) + PDA_Manifest.Cut() spawn() if(istype(usr,/mob/living/carbon/human)) From 844a856281bfa99ec8c598ea41f5d55d26221d84 Mon Sep 17 00:00:00 2001 From: Joey Haas Date: Tue, 4 Mar 2014 18:49:55 +0100 Subject: [PATCH 2/9] Fixed some machinery frames saying they need Manipulators instead of Micro Manipulators. --- code/game/machinery/constructable_frame.dm | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index b9b4fe0a04..bd2c66f42e 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -168,7 +168,7 @@ to destroy them and players will be able to make replacements. build_path = "/obj/machinery/r_n_d/destructive_analyzer" board_type = "machine" origin_tech = "magnets=2;engineering=2;programming=2" - frame_desc = "Requires 1 Scanning Module, 1 Manipulator, and 1 Micro-Laser." + frame_desc = "Requires 1 Scanning Module, 1 Micro Manipulator, and 1 Micro-Laser." req_components = list( "/obj/item/weapon/stock_parts/scanning_module" = 1, "/obj/item/weapon/stock_parts/manipulator" = 1, @@ -179,7 +179,7 @@ to destroy them and players will be able to make replacements. build_path = "/obj/machinery/autolathe" board_type = "machine" origin_tech = "engineering=2;programming=2" - frame_desc = "Requires 3 Matter Bins, 1 Manipulator, and 1 Console Screen." + frame_desc = "Requires 3 Matter Bins, 1 Micro Manipulator, and 1 Console Screen." req_components = list( "/obj/item/weapon/stock_parts/matter_bin" = 3, "/obj/item/weapon/stock_parts/manipulator" = 1, @@ -190,7 +190,7 @@ to destroy them and players will be able to make replacements. build_path = "/obj/machinery/r_n_d/protolathe" board_type = "machine" origin_tech = "engineering=2;programming=2" - frame_desc = "Requires 2 Matter Bins, 2 Manipulators, and 2 Beakers." + frame_desc = "Requires 2 Matter Bins, 2 Micro Manipulators, and 2 Beakers." req_components = list( "/obj/item/weapon/stock_parts/matter_bin" = 2, "/obj/item/weapon/stock_parts/manipulator" = 2, @@ -202,7 +202,7 @@ to destroy them and players will be able to make replacements. build_path = "/obj/machinery/r_n_d/circuit_imprinter" board_type = "machine" origin_tech = "engineering=2;programming=2" - frame_desc = "Requires 1 Matter Bin, 1 Manipulator, and 2 Beakers." + frame_desc = "Requires 1 Matter Bin, 1 Micro Manipulator, and 2 Beakers." req_components = list( "/obj/item/weapon/stock_parts/matter_bin" = 1, "/obj/item/weapon/stock_parts/manipulator" = 1, @@ -245,7 +245,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/mecha_part_fabricator" board_type = "machine" origin_tech = "programming=3;engineering=3" - frame_desc = "Requires 2 Matter Bins, 1 Manipulator, 1 Micro-Laser and 1 Console Screen." + frame_desc = "Requires 2 Matter Bins, 1 Micro Manipulator, 1 Micro-Laser and 1 Console Screen." req_components = list( "/obj/item/weapon/stock_parts/matter_bin" = 2, "/obj/item/weapon/stock_parts/manipulator" = 1, @@ -269,7 +269,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/dna_scannernew" board_type = "machine" origin_tech = "programming=2;biotech=2" - frame_desc = "Requires 1 Scanning module, 1 Manipulator, 1 Micro-Laser, 2 pieces of cable and 1 Console Screen." + frame_desc = "Requires 1 Scanning module, 1 Micro Manipulator, 1 Micro-Laser, 2 pieces of cable and 1 Console Screen." req_components = list( "/obj/item/weapon/stock_parts/scanning_module" = 1, "/obj/item/weapon/stock_parts/manipulator" = 1, @@ -285,7 +285,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/receiver" board_type = "machine" origin_tech = "programming=4;engineering=3;bluespace=2" - frame_desc = "Requires 1 Subspace Ansible, 1 Hyperwave Filter, 2 Manipulators, and 1 Micro-Laser." + frame_desc = "Requires 1 Subspace Ansible, 1 Hyperwave Filter, 2 Micro Manipulators, and 1 Micro-Laser." req_components = list( "/obj/item/weapon/stock_parts/subspace/ansible" = 1, "/obj/item/weapon/stock_parts/subspace/filter" = 1, @@ -297,7 +297,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/hub" board_type = "machine" origin_tech = "programming=4;engineering=4" - frame_desc = "Requires 2 Manipulators, 2 Cable Coil and 2 Hyperwave Filter." + frame_desc = "Requires 2 Micro Manipulators, 2 Cable Coil and 2 Hyperwave Filter." req_components = list( "/obj/item/weapon/stock_parts/manipulator" = 2, "/obj/item/weapon/cable_coil" = 2, @@ -308,7 +308,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/relay" board_type = "machine" origin_tech = "programming=3;engineering=4;bluespace=3" - frame_desc = "Requires 2 Manipulators, 2 Cable Coil and 2 Hyperwave Filters." + frame_desc = "Requires 2 Micro Manipulators, 2 Cable Coil and 2 Hyperwave Filters." req_components = list( "/obj/item/weapon/stock_parts/manipulator" = 2, "/obj/item/weapon/cable_coil" = 2, @@ -319,7 +319,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/bus" board_type = "machine" origin_tech = "programming=4;engineering=4" - frame_desc = "Requires 2 Manipulators, 1 Cable Coil and 1 Hyperwave Filter." + frame_desc = "Requires 2 Micro Manipulators, 1 Cable Coil and 1 Hyperwave Filter." req_components = list( "/obj/item/weapon/stock_parts/manipulator" = 2, "/obj/item/weapon/cable_coil" = 1, @@ -330,7 +330,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/processor" board_type = "machine" origin_tech = "programming=4;engineering=4" - frame_desc = "Requires 3 Manipulators, 1 Hyperwave Filter, 2 Treatment Disks, 1 Wavelength Analyzer, 2 Cable Coils and 1 Subspace Amplifier." + frame_desc = "Requires 3 Micro Manipulators, 1 Hyperwave Filter, 2 Treatment Disks, 1 Wavelength Analyzer, 2 Cable Coils and 1 Subspace Amplifier." req_components = list( "/obj/item/weapon/stock_parts/manipulator" = 3, "/obj/item/weapon/stock_parts/subspace/filter" = 1, @@ -344,7 +344,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/server" board_type = "machine" origin_tech = "programming=4;engineering=4" - frame_desc = "Requires 2 Manipulators, 1 Cable Coil and 1 Hyperwave Filter." + frame_desc = "Requires 2 Micro Manipulators, 1 Cable Coil and 1 Hyperwave Filter." req_components = list( "/obj/item/weapon/stock_parts/manipulator" = 2, "/obj/item/weapon/cable_coil" = 1, @@ -355,7 +355,7 @@ obj/item/weapon/circuitboard/rdserver build_path = "/obj/machinery/telecomms/broadcaster" board_type = "machine" origin_tech = "programming=4;engineering=4;bluespace=2" - frame_desc = "Requires 2 Manipulators, 1 Cable Coil, 1 Hyperwave Filter, 1 Ansible Crystal and 2 High-Powered Micro-Lasers. " + frame_desc = "Requires 2 Micro Manipulators, 1 Cable Coil, 1 Hyperwave Filter, 1 Ansible Crystal and 2 High-Powered Micro-Lasers. " req_components = list( "/obj/item/weapon/stock_parts/manipulator" = 2, "/obj/item/weapon/cable_coil" = 1, From 43d6412322cae11847fd57dd1ea0985e646f29a3 Mon Sep 17 00:00:00 2001 From: Mloc-Argent Date: Tue, 4 Mar 2014 22:14:57 +0000 Subject: [PATCH 3/9] Fix for a server-crashing issue in libnudge. Signed-off-by: Mloc-Argent --- lib/src/nudge.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/nudge.c b/lib/src/nudge.c index 90aa85fb5e..a71e766554 100644 --- a/lib/src/nudge.c +++ b/lib/src/nudge.c @@ -47,11 +47,11 @@ DLL_EXPORT const char * nudge(int n, char *v[]) { return ""; } - + size_t out_c = san_c(v[0]) + san_c(v[2]) + san_c(v[3]); char * san_out = malloc(out_c + 56); - + char * san_i = san_out; strcpy(san_i, "(dp1\nS'ip'\np2\nS'"); san_i += 16; @@ -67,7 +67,9 @@ DLL_EXPORT const char * nudge(int n, char *v[]) socket_t nudge_sock = connect_sock(v[1], "45678"); send_n(nudge_sock, san_out, out_c + 56); close_socket(nudge_sock); - + + free(san_out); + return "1"; } From 2063909ab00f56c9547838af11f7ff239e89f699 Mon Sep 17 00:00:00 2001 From: Joey Haas Date: Tue, 4 Mar 2014 23:51:12 +0100 Subject: [PATCH 4/9] Fixed the bug where mech fabricators would get stuck whenever the RnD console was not found. --- code/game/mecha/mech_fabricator.dm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 59abed9c23..f15ae7eb48 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -498,13 +498,15 @@ src.updateUsrDialog() return */ - if(!silent) + if(!silent) temp = "Updating local R&D database..." src.updateUsrDialog() sleep(30) //only sleep if called by user + var/found = 0 for(var/obj/machinery/computer/rdconsole/RDC in get_area(src)) if(!RDC.sync) continue + found++ for(var/datum/tech/T in RDC.files.known_tech) files.AddTech2Known(T) for(var/datum/design/D in RDC.files.known_designs) @@ -519,6 +521,11 @@ src.updateUsrDialog() if(i || tech_output) src.visible_message("\icon[src] [src] beeps, \"Successfully synchronized with R&D server. New data processed.\"") + if(found == 0) + temp = "Couldn't contact R&D server.
" + temp += "Return" + src.updateUsrDialog() + src.visible_message("\icon[src] [src] beeps, \"Error! Couldn't connect to R&D server.\"") return /obj/machinery/mecha_part_fabricator/proc/get_resource_cost_w_coeff(var/obj/item/part as obj,var/resource as text, var/roundto=1) From 74a8fa152c13750612284f8afe96860f80f59b41 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Tue, 4 Mar 2014 20:57:40 -0600 Subject: [PATCH 5/9] APC overlay bugfix. Before: If you turned off the breaker and fiddled with on/off states and turned on the breaker it wouldn't update the overlay because the check_updates wasn't doing an if(operating) check and would think it didn't need to update the overlays once you turned on the breaker. After: Check_update() is doing a check for the breaker being on or off and taking that into account with the update_overlay flags and will update the overlays properly. Thanks Razharas from /tg/ #coderbus for bringing this to my attention. --- code/modules/power/apc.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 7a5f17eeca..a98eb6a197 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -27,6 +27,7 @@ #define APC_UPOVERLAY_ENVIRON1 1024 #define APC_UPOVERLAY_ENVIRON2 2048 #define APC_UPOVERLAY_LOCKED 4096 +#define APC_UPOVERLAY_OPERATING 8192 #define APC_UPDATE_ICON_COOLDOWN 100 // 10 seconds @@ -323,6 +324,9 @@ if(update_state <= 1) update_state |= UPSTATE_ALLGOOD + if(operating) + update_overlay |= APC_UPOVERLAY_OPERATING + if(update_state & UPSTATE_ALLGOOD) if(locked) update_overlay |= APC_UPOVERLAY_LOCKED From 5c8fddcad087f49ea2bbb3bfa2345d42e2856936 Mon Sep 17 00:00:00 2001 From: Mloc Date: Wed, 5 Mar 2014 12:37:11 +0000 Subject: [PATCH 6/9] fuck --- lib/src/nudge.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/src/nudge.c b/lib/src/nudge.c index a71e766554..d9efb90b73 100644 --- a/lib/src/nudge.c +++ b/lib/src/nudge.c @@ -1,4 +1,3 @@ -#include #include #include @@ -50,7 +49,7 @@ DLL_EXPORT const char * nudge(int n, char *v[]) size_t out_c = san_c(v[0]) + san_c(v[2]) + san_c(v[3]); - char * san_out = malloc(out_c + 56); + char * san_out = malloc(out_c + 57); char * san_i = san_out; strcpy(san_i, "(dp1\nS'ip'\np2\nS'"); From 89114787e378e91575d1d950dc2b9032a844c883 Mon Sep 17 00:00:00 2001 From: DJSnapshot Date: Wed, 5 Mar 2014 23:44:03 -0800 Subject: [PATCH 7/9] Non-whitelisted IPCS Had to do a hacky fix. there was no real way around it. Also, a couple balances with IPCs And a totally silly death animation (Which has been commented out for now) --- code/game/jobs/whitelist.dm | 2 ++ code/modules/mob/living/carbon/human/human.dm | 3 ++- code/modules/mob/living/carbon/human/life.dm | 4 ++-- code/modules/mob/living/carbon/species.dm | 17 ++++++++++++----- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 98efaf9273..2feb525441 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -36,6 +36,8 @@ var/list/whitelist = list() return 1 if(species == "human" || species == "Human") return 1 + if(species == "machine" || species == "Machine") + return 1 if(check_rights(R_ADMIN, 0)) return 1 if(!alien_whitelist) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7dc0594a8f..d665ac31d6 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -37,8 +37,9 @@ ..() /mob/living/carbon/human/machine/New() - species = new /datum/species/machine(src) h_style = "blue IPC screen" + set_species("Machine") + ..() /mob/living/carbon/human/New() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 6e5e65c297..7769752abd 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1072,7 +1072,7 @@ E = get_visible_implants(0) if(!E.len) embedded_flag = 0 - + //Eyes if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own @@ -1296,7 +1296,7 @@ if(2) healths.icon_state = "health7" else //switch(health - halloss) - switch(100 - ((species && species.flags & NO_PAIN) ? 0 : traumatic_shock)) + switch(100 - ((species && species.flags & NO_PAIN & !IS_SYNTHETIC) ? 0 : traumatic_shock)) if(100 to INFINITY) healths.icon_state = "health0" if(80 to 100) healths.icon_state = "health1" if(60 to 80) healths.icon_state = "health2" diff --git a/code/modules/mob/living/carbon/species.dm b/code/modules/mob/living/carbon/species.dm index b046cce9c9..384774f14f 100644 --- a/code/modules/mob/living/carbon/species.dm +++ b/code/modules/mob/living/carbon/species.dm @@ -53,6 +53,13 @@ return /datum/species/proc/handle_death(var/mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns). + if(flags & IS_SYNTHETIC) + //H.make_jittery(200) //S-s-s-s-sytem f-f-ai-i-i-i-i-lure-ure-ure-ure + H.h_style = "" + spawn(100) + //H.is_jittery = 0 + //H.jitteriness = 0 + H.update_hair() return /datum/species/human @@ -219,8 +226,8 @@ punch_damage = 2 eyes = "blank_eyes" - brute_mod = 1.5 - burn_mod = 1.5 + brute_mod = 0.5 + burn_mod = 1 warning_low_pressure = 50 hazard_low_pressure = 10 @@ -233,7 +240,7 @@ heat_level_2 = 3000 heat_level_3 = 4000 - flags = NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | IS_SYNTHETIC + flags = IS_WHITELISTED | NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | IS_SYNTHETIC - blood_color = "#FFFFFF" - flesh_color = "#AAAAAA" \ No newline at end of file + blood_color = "#1F181F" + flesh_color = "#575757" From 63a27890fe9b04cc86290f26b3e6723aad579405 Mon Sep 17 00:00:00 2001 From: Mloc-Argent Date: Thu, 6 Mar 2014 09:36:58 +0000 Subject: [PATCH 8/9] Fix for apostrophes in IRC nudge. Signed-off-by: Mloc-Argent --- code/modules/admin/verbs/adminhelp.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 89a56065f0..e2504a0465 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -106,10 +106,10 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.") if(admin_number_present <= 0) if(!admin_number_afk) - send2adminirc("ADMINHELP from [key_name(src)]: [original_msg] - !!No admins online!!") + send2adminirc("ADMINHELP from [key_name(src)]: [html_decode(original_msg)] - !!No admins online!!") else - send2adminirc("ADMINHELP from [key_name(src)]: [original_msg] - !!All admins AFK ([admin_number_afk])!!") + send2adminirc("ADMINHELP from [key_name(src)]: [html_decode(original_msg)] - !!All admins AFK ([admin_number_afk])!!") else - send2adminirc("ADMINHELP from [key_name(src)]: [original_msg]") + send2adminirc("ADMINHELP from [key_name(src)]: [html_decode(original_msg)]") feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return From 4dba89a288bb155a8db05590f6ab54cd99a8b8a7 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Sat, 8 Mar 2014 03:38:30 +0400 Subject: [PATCH 9/9] Fix for #4542 Now synthetics do not contract viruses --- code/modules/virus2/helpers.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index 520f7931ec..0c95af7e09 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -65,7 +65,10 @@ proc/airborne_can_reach(turf/source, turf/target) // if one of the antibodies in the mob's body matches one of the disease's antigens, don't infect if(M.antibodies & disease.antigen != 0) return - + if(istype(M,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = M + if (H.species.flags & IS_SYNTHETIC) + return // log_debug("Infecting [M]") if(prob(disease.infectionchance) || forced)