From d838b942a6f9ff1b78932a324ec7c23a79f75f0c Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 00:31:04 -0400 Subject: [PATCH 01/14] Fixes lighting runtime caused by AI upload computer --- code/game/machinery/computer/law.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 670dabcccc1..ebd7f37e195 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -9,7 +9,7 @@ var/opened = 0 light_color = "#FFFFFF" - light_range_on = "2" + light_range_on = 2 verb/AccessInternals() From 2e2249d6f83763ba069020a4827f2918ed2a9637 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 01:19:15 -0400 Subject: [PATCH 02/14] Fixes global_announcer runtime (poorly) Load order changes mean globals used in the initialization of intercoms aren't created before the global_announcer intercom is created, which causes its creation to runtime. I have picked an effective but probably incredibly sloppy way to fix this runtime, because I'm not actually sure where this initialization code belongs --- code/_globalvars/misc.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 4dd134b57b2..2a936dde7b4 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -6,7 +6,13 @@ var/datum/nanomanager/nanomanager = new() // event manager, the manager for events var/datum/event_manager/event_manager = new() // Announcer intercom, because too much stuff creates an intercom for one message then hard del()s it. -var/global/obj/item/device/radio/intercom/global_announcer = new(null) +var/global/obj/item/device/radio/intercom/global_announcer = create_global_announcer() +// Load order issues means this can't be new'd until other code runs +// This is probably not the way I should be doing this, but I don't know how to do it right! +proc/create_global_announcer() + spawn(0) + global_announcer = new(null) + return var/list/paper_tag_whitelist = list("center","p","div","span","h1","h2","h3","h4","h5","h6","hr","pre", \ "big","small","font","i","u","b","s","sub","sup","tt","br","hr","ol","ul","li","caption","col", \ From 2efeed6410f1cfdbe2c99a69bfcf7d63adcd9aa0 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 01:41:46 -0400 Subject: [PATCH 03/14] Fixes blood reagent runtimes add_reagent was never creating blood with its default data, because it always nulled out the data if none was provided --- code/modules/reagents/Chemistry-Holder.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index e0064fec12e..594116bb805 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -488,7 +488,7 @@ datum R.holder = src R.volume = amount // SetViruses(R, data) // Includes setting data - R.data = data + if(data) R.data = data //debug //world << "Adding data" //for(var/D in R.data) From 505531f1a6904209256e27b92ff6c3a69a8e0177 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 02:03:09 -0400 Subject: [PATCH 04/14] Fixes AI crew monitor runtime Instead of the AI crew_monitor being a per-AI variable, it was shared by all AIs, and recreated each time a new AI was created, as part of that AI's contents. Bots create and delete a new AI every time they transmit, which means the crew_monitor would be deleted the moment a bot spoke over the radio, causing it to runtime. It is now a per-AI variable. --- code/modules/mob/living/silicon/ai/nano.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/silicon/ai/nano.dm b/code/modules/mob/living/silicon/ai/nano.dm index f9bb7a25d79..588849116ce 100644 --- a/code/modules/mob/living/silicon/ai/nano.dm +++ b/code/modules/mob/living/silicon/ai/nano.dm @@ -1,4 +1,5 @@ -var/obj/nano_module/crew_monitor/crew_monitor +/mob/living/silicon/ai + var/obj/nano_module/crew_monitor/crew_monitor /mob/living/silicon/ai/proc/init_subsystems() crew_monitor = new(src) From 224f0ff1d94e50d14925a2ff00a8c62b47391a73 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 02:14:34 -0400 Subject: [PATCH 05/14] Fixes soap cleaning runtime If you tried to clean an atom with soap, and that atom was deleted before you finished cleaning, the message attempting to display its name would runtime. --- code/game/objects/items/weapons/clown_items.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm index 84dc2d0c8b7..4e058dfc9d0 100644 --- a/code/game/objects/items/weapons/clown_items.dm +++ b/code/game/objects/items/weapons/clown_items.dm @@ -57,7 +57,7 @@ user << "You need to take that [target.name] off before cleaning it." else if(istype(target,/obj/effect/decal/cleanable)) user.visible_message("[user] begins to scrub \the [target.name] out with [src].") - if(do_after(user, src.cleanspeed)) + if(do_after(user, src.cleanspeed) && target) user << "You scrub \the [target.name] out." del(target) else From 89de5e89fe5665133bf9b0c18e9c06fd8a1c69aa Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 02:25:13 -0400 Subject: [PATCH 06/14] Fixes vending machine assembly runtime Vending machines would attempt to build_inventory using what appears to have been an old, multi-call method, including a named argument that no longer exists and would runtime. --- code/game/machinery/vending.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index e6bf09f19af..0a48ce5b3bb 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -168,9 +168,7 @@ /obj/machinery/vending/RefreshParts() //Better would be to make constructable child if(component_parts) - build_inventory(products, start_empty = 1) - build_inventory(contraband, 1, 1) - build_inventory(premium, 0, 1, 1) + build_inventory() for(var/obj/item/weapon/vending_refill/VR in component_parts) refill_inventory(VR, product_records) From 835276e07ed00561fb336f5d50b8bfeccd846d4c Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 03:18:43 -0400 Subject: [PATCH 07/14] Fixes cooking machinery runtimes Some recipes were sorted using paths that resulted in empty recipe types (for example, /datum/recipe/microwave/human/burger causing an empty /detum/recipe/microwave/human type to exist). These would be included in the available recipes, and since their requirements are null, would all be satisfied by anything in the machine. Since their result is null, a runtime would occur while trying to create nothing. This fixes some (all? Too lazy to test them all) kitchen machines never failing. --- code/game/machinery/kitchen/microwave.dm | 6 +++++- code/modules/food/candy_maker.dm | 6 +++++- code/modules/food/grill_new.dm | 6 +++++- code/modules/food/oven_new.dm | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 17b260747dd..1fba31f1da9 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -33,7 +33,11 @@ if (!available_recipes) available_recipes = new for (var/type in (typesof(/datum/recipe/microwave)-/datum/recipe/microwave)) - available_recipes+= new type + var/datum/recipe/recipe = new type + if(recipe.result) // Ignore recipe subtypes that lack a result + available_recipes += recipe + else + del(recipe) acceptable_items = new acceptable_reagents = new for (var/datum/recipe/microwave/recipe in available_recipes) diff --git a/code/modules/food/candy_maker.dm b/code/modules/food/candy_maker.dm index 269c2fcc33b..7e12fc327bf 100644 --- a/code/modules/food/candy_maker.dm +++ b/code/modules/food/candy_maker.dm @@ -33,7 +33,11 @@ if (!available_recipes) available_recipes = new for (var/type in (typesof(/datum/recipe/candy)-/datum/recipe/candy)) - available_recipes+= new type + var/datum/recipe/recipe = new type + if(recipe.result) // Ignore recipe subtypes that lack a result + available_recipes += recipe + else + del(recipe) acceptable_items = new acceptable_reagents = new for (var/datum/recipe/candy/recipe in available_recipes) diff --git a/code/modules/food/grill_new.dm b/code/modules/food/grill_new.dm index 6fcd5e3a31a..ee8bd4bf460 100644 --- a/code/modules/food/grill_new.dm +++ b/code/modules/food/grill_new.dm @@ -34,7 +34,11 @@ if (!available_recipes) available_recipes = new for (var/type in (typesof(/datum/recipe/grill)-/datum/recipe/grill)) - available_recipes+= new type + var/datum/recipe/recipe = new type + if(recipe.result) // Ignore recipe subtypes that lack a result + available_recipes += recipe + else + del(recipe) acceptable_items = new acceptable_reagents = new for (var/datum/recipe/grill/recipe in available_recipes) diff --git a/code/modules/food/oven_new.dm b/code/modules/food/oven_new.dm index 1b0c3559cf0..7d6022ae9ae 100644 --- a/code/modules/food/oven_new.dm +++ b/code/modules/food/oven_new.dm @@ -34,7 +34,11 @@ if (!available_recipes) available_recipes = new for (var/type in (typesof(/datum/recipe/oven)-/datum/recipe/oven)) - available_recipes+= new type + var/datum/recipe/recipe = new type + if(recipe.result) // Ignore recipe subtypes that lack a result + available_recipes += recipe + else + del(recipe) acceptable_items = new acceptable_reagents = new for (var/datum/recipe/oven/recipe in available_recipes) From f575331f74c78a643b94c5d7336196b7668b1b71 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 03:36:22 -0400 Subject: [PATCH 08/14] Fixes runtime in health analyzers --- code/game/objects/items/devices/scanners.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index de473470896..019e5f02896 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -227,6 +227,8 @@ REAGENT SCANNER for(var/name in H.organs_by_name) var/obj/item/organ/external/e = H.organs_by_name[name] + if(!e) + continue if(e.status & ORGAN_BROKEN) user.show_message(text("\red Bone fractures detected. Advanced scanner required for location."), 1) break From 023fc200bb6c325ab637dc93890e580803390346 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 03:56:51 -0400 Subject: [PATCH 09/14] Fixes runtimes from pAI attacks pAIs inherited UnarmedAttack from /mob/living, which caused them to attempt to attack_animal() things they clicked, which would generally runtime on account of not having the variables expected from a simple_animal. --- code/_onclick/other_mobs.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 1dd064219a5..3edd0ba0bde 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -119,3 +119,7 @@ */ /mob/new_player/ClickOn() return + +// pAIs are not intended to interact with anything in the world +/mob/living/silicon/pai/UnarmedAttack(var/atom/A) + return From e42e53aac899ff8cb7c40904f5eac022f96e5780 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 04:54:03 -0400 Subject: [PATCH 10/14] Fixes stripping's pickpocket check runtimes When attempting to strip a human, wearing pickpocket gloves makes certain actions stealthy. Some of the checks for pickpocket gloves would runtime when a non-human mob attempted to pickpocket certain slots; these runtimes have been fixed. As a consequence of this change, cyborgs - and perhaps certain other mobs - will now be able to remove IDs and empty pockets. --- code/modules/mob/living/carbon/human/human.dm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3ae591eeadd..16028dde831 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -667,13 +667,16 @@ /mob/living/carbon/human/Topic(href, href_list) var/pickpocket = 0 + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + var/obj/item/clothing/gloves/G = H.gloves + if(G) + pickpocket = G.pickpocket + if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr)) // if looting pockets with gloves, do it quietly if(href_list["pockets"]) - if(usr:gloves) - var/obj/item/clothing/gloves/G = usr:gloves - pickpocket = G.pickpocket var/pocket_side = href_list["pockets"] var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store) var/obj/item/pocket_item = (pocket_id == slot_r_store ? src.r_store : src.l_store) @@ -712,9 +715,6 @@ if(href_list["item"]) var/itemTarget = href_list["item"] if(itemTarget == "id") - if(usr:gloves) - var/obj/item/clothing/gloves/G = usr:gloves - pickpocket = G.pickpocket if(pickpocket) var/obj/item/worn_id = src.wear_id var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty @@ -759,9 +759,6 @@ if ((href_list["item"] && !( usr.stat ) && usr.canmove && !( usr.restrained() ) && in_range(src, usr) && ticker)) //if game hasn't started, can't make an equip_e var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) - if(ishuman(usr) && usr:gloves) - var/obj/item/clothing/gloves/G = usr:gloves - pickpocket = G.pickpocket if(!pickpocket || href_list["item"] != "id") // Stop the non-stealthy verbose strip if pickpocketing id. O.source = usr O.target = src From aee11e857ab4af3790066a025fb8a67a25ad9235 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 05:20:49 -0400 Subject: [PATCH 11/14] Fixes cryopod item preservation runtimes Cryopods attempt to preserve certain important items when despawning their occupants. They also attempt to remove the contents of anything on their occupants. Some preserved items have important contents, which should not be removed, and may cause runtimes after retrieval. This should fix those runtimes. --- code/game/machinery/cryopod.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 04d83139453..30db6a7d225 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -307,6 +307,13 @@ W.loc = src if(W.contents.len) //Make sure we catch anything not handled by del() on the items. + var/preserve = null + for(var/T in preserve_items) + if(istype(W,T)) + preserve = 1 + break + if(preserve) // Don't remove the contents of things that need preservation + continue for(var/obj/item/O in W.contents) if(istype(O,/obj/item/weapon/tank)) //Stop eating pockets, you fuck! continue From 575ed36fdca6fb14f3e904ec434c9e75839e5e62 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 05:46:53 -0400 Subject: [PATCH 12/14] Fixes eye stabbing runtime This will allow eye stabbing to properly weaken victims. --- code/game/objects/items.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a6879546e11..f73a366ea94 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -634,7 +634,7 @@ eyes.take_damage(rand(3,4), 1) if(eyes.damage >= eyes.min_bruised_damage) if(M.stat != 2) - if(!(eyes & ORGAN_ROBOT) || !(eyes & ORGAN_ASSISTED)) //robot eyes bleeding might be a bit silly + if(!(eyes.status & ORGAN_ROBOT) || !(eyes.status & ORGAN_ASSISTED)) //robot eyes bleeding might be a bit silly M << "\red Your eyes start to bleed profusely!" if(prob(50)) if(M.stat != 2) From 67323c8309e25f26ffc270fc9584ad2c0a3970d6 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 06:16:16 -0400 Subject: [PATCH 13/14] Fixes clientless pAI booping runtime pAIs without an active client can now be booped back into their card form. --- code/modules/mob/living/silicon/pai/pai.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index fdef89d6865..ae26734975f 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -457,8 +457,9 @@ if(istype(T)) T.visible_message("[src] neatly folds inwards, compacting down to a rectangular card.") src.stop_pulling() - src.client.perspective = EYE_PERSPECTIVE - src.client.eye = card + if(src.client) + src.client.perspective = EYE_PERSPECTIVE + src.client.eye = card //This seems redundant but not including the forced loc setting messes the behavior up. src.loc = card From bfa93d5cd9ffd8e1fa6c9b0cf5ce983525892622 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 06:23:48 -0400 Subject: [PATCH 14/14] Fixes detached organ process() runtime This may cause certain organs that wouldn't previously take damage over time to now do so. --- code/modules/organs/organ.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 6b0a26b2520..064211d30b5 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -77,10 +77,11 @@ var/list/organ_cache = list() owner = null if(!owner) - var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list - if(B && prob(40)) - reagents.remove_reagent("blood",0.1) - blood_splatter(src,B,1) + if(reagents) + var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list + if(B && prob(40)) + reagents.remove_reagent("blood",0.1) + blood_splatter(src,B,1) if(prob(5)) //How about we not have organs become completely useless less than a minute after removal? damage += 1