diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index 0887e2160c7..e8e6526fff7 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -977,6 +977,8 @@ Turf and target are seperate in case you want to teleport some distance from a t /proc/get_edge_target_turf(var/atom/A, var/direction) var/turf/target = locate(A.x, A.y, A.z) + if(!A || !target) + return 0 //since NORTHEAST == NORTH & EAST, etc, doing it this way allows for diagonal mass drivers in the future //and isn't really any more complicated diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index 09629535ca3..7edad2b1a64 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -99,6 +99,8 @@ return /atom/proc/add_fingerprint(mob/living/M as mob) + if(!istype(src.fingerprints, /list)) + src.fingerprints = params2list(src.fingerprints) if(isnull(M)) return if(isnull(M.key)) return if (!( src.flags ) & 256) diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 29867b5dd97..b1d1fb1d867 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -55,7 +55,7 @@ if ((usr.contents.Find(src) || (in_range(src,usr) && istype(src.loc, /turf)))) usr.machine = src if(href_list["spell_choice"]) - if(src.uses >= 1 && src.max_uses >=1 && href_list["spell_choice"] != 18) + if(src.uses >= 1 && src.max_uses >=1 && text2num(href_list["spell_choice"]) < 18) src.uses-- if(spell_type == "verb") switch(href_list["spell_choice"]) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 8f3a9728063..ca7d1dbb66a 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -139,8 +139,9 @@ //Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO return usr.pulling = null - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src + if(usr && usr.client) + usr.client.perspective = EYE_PERSPECTIVE + usr.client.eye = src usr.loc = src src.occupant = usr /*for(var/obj/O in src) diff --git a/code/game/turf.dm b/code/game/turf.dm index a5c9b66c80e..2dbaa0f8197 100644 --- a/code/game/turf.dm +++ b/code/game/turf.dm @@ -629,19 +629,21 @@ user << "\blue Prying outer sheath off." playsound(src.loc, 'Crowbar.ogg', 100, 1) sleep(100) - if ((user.loc == T && user.equipped() == W)) - user << "\blue You removed the outer sheath." - dismantle_wall() - return + if(src) + if ((user.loc == T && user.equipped() == W)) + user << "\blue You removed the outer sheath." + dismantle_wall() + return else if (istype(W, /obj/item/weapon/pickaxe/diamonddrill)) var/turf/T = user.loc user << "\blue You begin to drill though, this will take some time." sleep(200) - if ((user.loc == T && user.equipped() == W)) - user << "\blue Your drill tears though the reinforced plating." - dismantle_wall() - return + if(src) + if ((user.loc == T && user.equipped() == W)) + user << "\blue Your drill tears though the reinforced plating." + dismantle_wall() + return else if ((istype(W, /obj/item/stack/sheet/metal)) && (src.d_state)) var/turf/T = user.loc diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 3afaf10d9fd..82e14160036 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -67,7 +67,6 @@ verbs += /client/proc/debug_variables //verbs += /client/proc/cmd_modify_object_variables --Merged with view variables verbs += /client/proc/cmd_modify_ticker_variables - verbs += /client/proc/toggleadminhelpsound // Admin helpers verbs += /client/proc/toggle_view_range @@ -81,6 +80,7 @@ verbs += /client/proc/jumptomob verbs += /client/proc/jumptoturf verbs += /client/proc/jumptocoord + verbs += /client/proc/cmd_admin_delete verbs += /client/proc/cmd_admin_add_freeform_ai_law verbs += /client/proc/cmd_admin_rejuvenate @@ -197,9 +197,7 @@ //verbs += /client/proc/cmd_admin_godmode --now in view variables verbs += /client/proc/cmd_admin_rejuvenate //verbs += /client/proc/cmd_admin_gib --View vars menu - verbs += /client/proc/cmd_admin_delete //verbs += /proc/togglebuildmode --now in view vars - verbs += /client/proc/toggleadminhelpsound // verbs += /client/proc/togglebuildmodeself verbs += /client/proc/hide_most_verbs verbs += /client/proc/jumptocoord @@ -220,6 +218,7 @@ verbs += /client/proc/toggleprayers verbs += /client/proc/deadmin_self verbs += /client/proc/tension_report + verbs += /client/proc/toggleadminhelpsound if (holder.level >= 2)//Admin Candidate******************************************************************** verbs += /client/proc/cmd_admin_add_random_ai_law diff --git a/code/modules/food/food.dm b/code/modules/food/food.dm index a972494515e..acd2dcc96f7 100644 --- a/code/modules/food/food.dm +++ b/code/modules/food/food.dm @@ -797,12 +797,13 @@ if(!reagents.total_volume) var/mob/M = usr var/obj/item/weapon/paper/paper = locate() in src - M.visible_message( \ - "\blue [M] takes a piece of paper from the cookie!", \ - "\blue You take a piece of paper from the cookie! Read it!" \ - ) - M.put_in_hand(paper) - paper.add_fingerprint(M) + if(paper) + M.visible_message( \ + "\blue [M] takes a piece of paper from the cookie!", \ + "\blue You take a piece of paper from the cookie! Read it!" \ + ) + M.put_in_hand(paper) + paper.add_fingerprint(M) /obj/item/weapon/reagent_containers/food/snacks/badrecipe name = "Burned mess" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f9b432785e5..cdfa1eb3f8a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -2051,7 +2051,7 @@ It can still be worn/put on as normal. var/obj/item/device/pda/pda = wear_id var/obj/item/weapon/card/id/id = wear_id if (istype(pda)) - if (pda.id) + if (pda.id && istype(pda.id, /obj/item/weapon/card/id)) . = pda.id.assignment else . = pda.ownjob diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 5b08451b52c..e88b5d0756a 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -467,7 +467,7 @@ var/transfer_coefficient transfer_coefficient = 1 - if(head && (head.body_parts_covered & HEAD) && (environment.temperature < head.protective_temperature)) + if(head && (head.body_parts_covered & HEAD) && (environment.temperature < head.protective_temperature) && !istype(head, /obj/item/weapon/paper)) transfer_coefficient *= head.heat_transfer_coefficient if(wear_mask && (wear_mask.body_parts_covered & HEAD) && (environment.temperature < wear_mask.protective_temperature)) transfer_coefficient *= wear_mask.heat_transfer_coefficient diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index f190b175576..3d9e3792770 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -83,6 +83,8 @@ /obj/item/weapon/grab/proc/s_click(obj/screen/S as obj) + if (!affecting) + return if (assailant.next_move > world.time) return if ((!( assailant.canmove ) || assailant.lying)) diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index dcfb3b7719f..33eca64b064 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -374,6 +374,8 @@ datum/preferences proc/process_link(mob/user, list/link_tags) + if(!usr) + return if(link_tags["occ"]) if(link_tags["cancel"]) user << browse(null, "window=\ref[user]occupation") diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 9075a4732b5..9ec0efd7156 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -845,18 +845,19 @@ malfai.malfhack = src malfai.malfhacking = 1 sleep(600) - if (!src.aidisabled) - malfai.malfhack = null - malfai.malfhacking = 0 - if (ticker.mode.config_tag == "malfunction") - if (src.z == 1) //if (is_type_in_list(get_area(src), the_station_areas)) - ticker.mode:apcs++ - if(usr:parent) - src.malfai = usr:parent - else - src.malfai = usr - malfai << "Hack complete. The APC is now under your exclusive control." - updateicon() + if(src) + if (!src.aidisabled) + malfai.malfhack = null + malfai.malfhacking = 0 + if (ticker.mode.config_tag == "malfunction") + if (src.z == 1) //if (is_type_in_list(get_area(src), the_station_areas)) + ticker.mode:apcs++ + if(usr:parent) + src.malfai = usr:parent + else + src.malfai = usr + malfai << "Hack complete. The APC is now under your exclusive control." + updateicon() else if (href_list["occupyapc"]) malfoccupy(usr)