From fedb05b3be8014ac41586f9649bffdea511a0d14 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 2 Feb 2020 05:43:38 +0100 Subject: [PATCH] A PR about runtime errors --- .../objects/structures/crates_lockers/crates.dm | 2 +- code/modules/admin/admin_verbs.dm | 7 ++++--- code/modules/admin/topic.dm | 8 ++++---- .../carbon/human/species_types/mushpeople.dm | 17 +++++++++-------- .../reagents/reagent_containers/dropper.dm | 7 +------ code/modules/surgery/organs/eyes.dm | 2 ++ 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index eaa9074bd8..8e7121b109 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -81,7 +81,7 @@ /obj/structure/closet/crate/coffin/examine(mob/user) . = ..() - if(user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + if(user.mind?.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) . += {"This is a coffin which you can use to regenerate your burns and other wounds faster."} . += {"You can also thicken your blood if you survive the day, and hide from the sun safely while inside."} /* if(user.mind.has_antag_datum(ANTAG_DATUM_VASSAL) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 8a7269ccad..bdf665082d 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -343,12 +343,12 @@ GLOBAL_PROTECT(admin_verbs_hideable) set category = "Admin" set name = "Aghost" if(!holder) - return + return FALSE if(isobserver(mob)) //re-enter var/mob/dead/observer/ghost = mob if(!ghost.mind || !ghost.mind.current) //won't do anything if there is no body - return + return FALSE if(!ghost.can_reenter_corpse) log_admin("[key_name(usr)] re-entered corpse") message_admins("[key_name_admin(usr)] re-entered corpse") @@ -357,6 +357,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin Reenter") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else if(isnewplayer(mob)) to_chat(src, "Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.") + return FALSE else //ghostize log_admin("[key_name(usr)] admin ghosted.") @@ -366,7 +367,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(body && !body.key) body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin Ghost") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - + return TRUE /client/proc/invisimin() set name = "Invisimin" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index c76ecb52f5..ac158acb28 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1983,8 +1983,8 @@ var/atom/movable/AM = locate(href_list["adminplayerobservefollow"]) var/client/C = usr.client - if(!isobserver(usr)) - C.admin_ghost() + if(!isobserver(usr) && !C.admin_ghost()) + return var/mob/dead/observer/A = C.mob A.ManualFollow(AM) @@ -2006,8 +2006,8 @@ var/z = text2num(href_list["Z"]) var/client/C = usr.client - if(!isobserver(usr)) - C.admin_ghost() + if(!isobserver(usr) && !C.admin_ghost()) + return sleep(2) C.jumptocoord(x,y,z) diff --git a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm index ab0962cf12..2580e3b9f0 100644 --- a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm @@ -31,14 +31,15 @@ /datum/species/mush/on_species_gain(mob/living/carbon/C, datum/species/old_species) . = ..() - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if(!H.dna.features["caps"]) - H.dna.features["caps"] = "Round" - handle_mutant_bodyparts(H) - H.faction |= "mushroom" - mush = new() - mush.teach(H, TRUE) + if(!ishuman(C)) + return + var/mob/living/carbon/human/H = C + if(!H.dna.features["caps"]) + H.dna.features["caps"] = "Round" + handle_mutant_bodyparts(H) + H.faction |= "mushroom" + mush = new() + mush.teach(H, TRUE) RegisterSignal(C, COMSIG_MOB_ON_NEW_MIND, .proc/on_new_mind) /datum/species/mush/proc/on_new_mind(mob/owner) diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index cbfe5173dd..9feec362a4 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -64,12 +64,7 @@ reagents.reaction(target, TOUCH, fraction) var/mob/M = target - var/R - if(reagents) - for(var/datum/reagent/A in src.reagents.reagent_list) - R += A.type + " (" - R += num2text(A.volume) + ")," - log_combat(user, M, "squirted", R) + log_combat(user, M, "squirted", reagents.log_list()) trans = src.reagents.trans_to(target, amount_per_transfer_from_this) to_chat(user, "You transfer [trans] unit\s of the solution.") diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index c09d1ac1fc..d2e2f3f3f4 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -255,6 +255,8 @@ if(!C || QDELETED(src) || QDELETED(user) || QDELETED(owner) || owner != user) return var/range = input(user, "Enter range (0 - [max_light_beam_distance])", "Range Select", 0) as null|num + if(!isnum(range)) + return set_distance(CLAMP(range, 0, max_light_beam_distance)) assume_rgb(C)