From a2ff959950a1f0e1b49dba7eb99082f14301a1d8 Mon Sep 17 00:00:00 2001 From: AnturK Date: Wed, 26 Feb 2020 13:47:31 +0100 Subject: [PATCH] Batch of runtime fixes. (#49568) * Fixes secret sauce recipe paper. * Fixes say runtime * Fixes modular computer on holodeck runtime * Fixes bee runtime * Fixes grav holopara runtime * Fixes olfaction runtime * Fixes zombie runtime. * Cleanup --- code/datums/mutations/actions.dm | 7 ++++--- .../mob/living/carbon/human/species_types/zombies.dm | 2 +- code/modules/mob/living/say.dm | 2 +- .../simple_animal/guardian/types/gravitokinetic.dm | 2 ++ code/modules/mob/living/simple_animal/hostile/bees.dm | 4 ++++ .../mob/living/simple_animal/hostile/giant_spider.dm | 11 +++++++---- .../modular_computers/computers/item/processor.dm | 3 ++- code/modules/reagents/chemistry/recipes/special.dm | 3 ++- 8 files changed, 23 insertions(+), 11 deletions(-) diff --git a/code/datums/mutations/actions.dm b/code/datums/mutations/actions.dm index 1d27c35e776..40af7caac07 100644 --- a/code/datums/mutations/actions.dm +++ b/code/datums/mutations/actions.dm @@ -54,9 +54,10 @@ var/old_target = tracking_target possible = list() var/list/prints = sniffed.return_fingerprints() - for(var/mob/living/carbon/C in GLOB.carbon_list) - if(prints[md5(C.dna.uni_identity)]) - possible |= C + if(prints) + for(var/mob/living/carbon/C in GLOB.carbon_list) + if(prints[md5(C.dna.uni_identity)]) + possible |= C if(!length(possible)) to_chat(user,"Despite your best efforts, there are no scents to be found on [sniffed]...") return diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm index c522874c8ea..2fafbcbcfbe 100644 --- a/code/modules/mob/living/carbon/human/species_types/zombies.dm +++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm @@ -67,7 +67,7 @@ playsound(C, pick(spooks), 50, TRUE, 10) //Congrats you somehow died so hard you stopped being a zombie -/datum/species/zombie/infectious/spec_death(mob/living/carbon/C) +/datum/species/zombie/infectious/spec_death(gibbed, mob/living/carbon/C) . = ..() var/obj/item/organ/zombie_infection/infection infection = C.getorganslot(ORGAN_SLOT_ZOMBIE) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 2498c376a3b..204cfb90f29 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -328,7 +328,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( /mob/living/proc/get_key(message) var/key = message[1] - if(key in GLOB.department_radio_prefixes) + if((key in GLOB.department_radio_prefixes) && length(message) > length(key) + 1) return lowertext(message[1 + length(key)]) /mob/living/proc/get_message_language(message) diff --git a/code/modules/mob/living/simple_animal/guardian/types/gravitokinetic.dm b/code/modules/mob/living/simple_animal/guardian/types/gravitokinetic.dm index 768c50e73ee..32ec8e5f55a 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/gravitokinetic.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/gravitokinetic.dm @@ -49,6 +49,8 @@ remove_gravity(i) /mob/living/simple_animal/hostile/guardian/gravitokinetic/proc/add_gravity(atom/A, new_gravity = 2) + if(gravito_targets[A]) + return A.AddElement(/datum/element/forced_gravity, new_gravity) gravito_targets[A] = new_gravity RegisterSignal(A, COMSIG_MOVABLE_MOVED, .proc/__distance_check) diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index 04020f22135..5f810bb1ef1 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -159,6 +159,10 @@ beegent.reaction_mob(L, INJECT) L.reagents.add_reagent(beegent.type, rand(1,5)) +/mob/living/simple_animal/hostile/poison/bees/inject_poison(mob/living/L) + if(beegent && istype(L) && L.reagents) + beegent.reaction_mob(L, INJECT) + L.reagents.add_reagent(beegent.type, rand(1,5)) /mob/living/simple_animal/hostile/poison/bees/proc/assign_reagent(datum/reagent/R) if(istype(R)) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 4a556a8197b..d982109feb6 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -10,10 +10,13 @@ /mob/living/simple_animal/hostile/poison/AttackingTarget() . = ..() - if(. && isliving(target)) - var/mob/living/L = target - if(L.reagents) - L.reagents.add_reagent(poison_type, poison_per_bite) + if(.) + inject_poison(target) + +/// Handles injecting the poison after successful attack +/mob/living/simple_animal/hostile/poison/proc/inject_poison(mob/living/L) + if(poison_type && istype(L) && L.reagents) + L.reagents.add_reagent(poison_type, poison_per_bite) //basic spider mob, these generally guard nests /mob/living/simple_animal/hostile/poison/giant_spider diff --git a/code/modules/modular_computers/computers/item/processor.dm b/code/modules/modular_computers/computers/item/processor.dm index c7d1107f3c3..e5e522af641 100644 --- a/code/modules/modular_computers/computers/item/processor.dm +++ b/code/modules/modular_computers/computers/item/processor.dm @@ -12,10 +12,11 @@ var/obj/machinery/modular_computer/machinery_computer = null /obj/item/modular_computer/processor/Destroy() - . = ..() if(machinery_computer && (machinery_computer.cpu == src)) machinery_computer.cpu = null + machinery_computer.UnregisterSignal(src, COMSIG_ATOM_UPDATED_ICON) machinery_computer = null + . = ..() /obj/item/modular_computer/processor/New(comp) ..() diff --git a/code/modules/reagents/chemistry/recipes/special.dm b/code/modules/reagents/chemistry/recipes/special.dm index 2549257946e..57b813f086c 100644 --- a/code/modules/reagents/chemistry/recipes/special.dm +++ b/code/modules/reagents/chemistry/recipes/special.dm @@ -165,7 +165,7 @@ GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related /obj/item/paper/secretrecipe name = "old recipe" - var/recipe_id = "secretsauce" + var/recipe_id = /datum/chemical_reaction/randomized/secret_sauce /obj/item/paper/secretrecipe/examine(mob/user) //Extra secret if(isobserver(user)) @@ -183,6 +183,7 @@ GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related var/datum/chemical_reaction/recipe = get_chemical_reaction(recipe_id) if(!recipe) info = "This recipe is illegible." + return var/list/dat = list("