From 0c9cd7a7ff5431377f796b1b1526a67bdcbdf5b6 Mon Sep 17 00:00:00 2001 From: Heroman Date: Thu, 15 Sep 2022 15:37:12 +1000 Subject: [PATCH] Fixes some adminverb runtimes --- code/game/jobs/job_controller.dm | 2 +- code/modules/admin/verbs/buildmode.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 2c8f6dd8b8..f4c016785d 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -393,7 +393,7 @@ var/global/datum/controller/occupations/job_master //Equip custom gear loadout. var/list/custom_equip_slots = list() var/list/custom_equip_leftovers = list() - if(H.client.prefs.gear && H.client.prefs.gear.len && !(job.mob_type & JOB_SILICON)) + if(H.client && H.client.prefs && H.client.prefs.gear && H.client.prefs.gear.len && !(job.mob_type & JOB_SILICON)) for(var/thing in H.client.prefs.gear) var/datum/gear/G = gear_datums[thing] if(!G) //Not a real gear datum (maybe removed, as this is loaded from their savefile) diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm index d9aacdcaca..485cc88e22 100644 --- a/code/modules/admin/verbs/buildmode.dm +++ b/code/modules/admin/verbs/buildmode.dm @@ -364,7 +364,7 @@ if(ispath(holder.buildmode.objholder,/turf)) var/turf/T = get_turf(object) T.ChangeTurf(holder.buildmode.objholder) - else + else if(ispath(holder.buildmode.objholder)) var/obj/A = new holder.buildmode.objholder (get_turf(object)) A.set_dir(holder.builddir.dir) else if(pa.Find("right")) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 90cd3ae037..4ae6532daf 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -530,8 +530,9 @@ Traitors and the like can also be revived with the previous role mostly intact. if(equipment) if(charjob) job_master.EquipRank(new_character, charjob, 1) - new_character.mind.assigned_role = charjob - new_character.mind.role_alt_title = job_master.GetPlayerAltTitle(new_character, charjob) + if(new_character.mind) + new_character.mind.assigned_role = charjob + new_character.mind.role_alt_title = job_master.GetPlayerAltTitle(new_character, charjob) //equip_custom_items(new_character) //VOREStation Removal //If desired, add records. @@ -550,10 +551,10 @@ Traitors and the like can also be revived with the previous role mostly intact. log_admin("[admin] has spawned [player_key]'s character [new_character.real_name].") message_admins("[admin] has spawned [player_key]'s character [new_character.real_name].", 1) - + feedback_add_details("admin_verb","RSPCH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - + // Drop pods if(showy == "Polite") var/turf/T = get_turf(new_character) @@ -1078,7 +1079,7 @@ Traitors and the like can also be revived with the previous role mostly intact. set name = "Drop Pod Atom" set desc = "Spawn a new atom/movable in a drop pod where you are." set category = "Fun" - + if(!check_rights(R_SPAWN)) return @@ -1099,7 +1100,7 @@ Traitors and the like can also be revived with the previous role mostly intact. chosen = tgui_input_list(usr, "Select a movable type:", "Spawn in Drop Pod", matches) if(!chosen) return - + var/podtype = tgui_alert(src,"Destructive drop pods cause damage in a 3x3 and may break turfs. Polite drop pods lightly damage the turfs but won't break through.", "Drop Pod", list("Polite", "Destructive", "Cancel")) if(podtype == "Cancel") return @@ -1120,14 +1121,14 @@ Traitors and the like can also be revived with the previous role mostly intact. set name = "Drop Pod Deploy" set desc = "Drop an existing mob where you are in a drop pod." set category = "Fun" - + if(!check_rights(R_SPAWN)) return var/mob/living/L = tgui_input_list(usr, "Select the mob to drop:", "Mob Picker", living_mob_list) if(!L) return - + var/podtype = tgui_alert(src,"Destructive drop pods cause damage in a 3x3 and may break turfs. Polite drop pods lightly damage the turfs but won't break through.", "Drop Pod", list("Polite", "Destructive", "Cancel")) if(podtype == "Cancel") return