From eba614d78fb7b3d3eb842b62eff32f240336df7a Mon Sep 17 00:00:00 2001 From: "mport2004@gmail.com" Date: Wed, 26 Oct 2011 23:15:34 +0000 Subject: [PATCH] Fixed some runtimes Gibber now properly checks for clothes when you attempt to shove people in it. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2429 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/procs/gamehelpers.dm | 2 +- code/game/machinery/cryo.dm | 18 ----------------- code/game/machinery/hydroponics.dm | 2 +- code/game/machinery/kitchen/gibber.dm | 2 +- code/modules/assembly/signaler.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 8 ++++++++ code/modules/mob/living/silicon/robot/laws.dm | 4 ++-- code/modules/mob/mob_helpers.dm | 11 ++++++++++ code/modules/research/designs.dm | 20 +++++-------------- 9 files changed, 30 insertions(+), 39 deletions(-) diff --git a/code/defines/procs/gamehelpers.dm b/code/defines/procs/gamehelpers.dm index d3945ffa362..6e16c91e4f3 100644 --- a/code/defines/procs/gamehelpers.dm +++ b/code/defines/procs/gamehelpers.dm @@ -28,7 +28,7 @@ /proc/in_range(source, user) if(get_dist(source, user) <= 1) return 1 - else + else//TK TODO: remove this if(istype(user, /mob/living/carbon)) if(user:mutations & PORTALS && get_dist(source, user) <= 7) if(user:equipped()) return 0 diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index ffd6b094e73..3d1ed3b36c5 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -268,24 +268,6 @@ - - -/mob/living/carbon/human/abiotic() -// if ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.ears || src.gloves)) - if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract ))) - return 1 - else - return 0 - return - -/mob/proc/abiotic() -// if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || src.back || src.wear_mask) - if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract ))) - return 1 - else - return 0 - return - /datum/data/function/proc/reset() return diff --git a/code/game/machinery/hydroponics.dm b/code/game/machinery/hydroponics.dm index f51643099f6..a9c3cb1a8c4 100644 --- a/code/game/machinery/hydroponics.dm +++ b/code/game/machinery/hydroponics.dm @@ -847,7 +847,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) else podman.real_name = "pod person" //No null names!! - if(mind && istype(mind,/datum/mind) && mind.current.stat == 2) //only transfer dead people's minds + if(mind && istype(mind,/datum/mind) && mind.current && mind.current.stat == 2) //only transfer dead people's minds mind:transfer_to(podman) mind:original = podman else //welp diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm index 9f528bc79ad..7da11995c97 100644 --- a/code/game/machinery/kitchen/gibber.dm +++ b/code/game/machinery/kitchen/gibber.dm @@ -55,7 +55,7 @@ if (!( istype(G, /obj/item/weapon/grab)) || !(istype(G.affecting, /mob/living/carbon/human))) user << "\red This item is not suitable for the gibber!" return - if(G.affecting.abiotic()) + if(G.affecting.abiotic(1)) user << "\red Subject may not have abiotic items on." return diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index aad0f0f2f2b..27d431492b5 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -101,7 +101,7 @@ if(S == src) continue if((S.frequency == src.frequency) && (S.code == src.code)) spawn(0) - S.pulse(0) + if(S) S.pulse(0) return 0 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index cd307b3212f..d0502da2081 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -2196,3 +2196,11 @@ It can still be worn/put on as normal. src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss - src.cloneloss +/mob/living/carbon/human/abiotic(var/full_body = 0) + if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.ears || src.gloves))) + return 1 + + if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract ))) + return 1 + + return 0 \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/laws.dm b/code/modules/mob/living/silicon/robot/laws.dm index a405565d151..69288156ee1 100644 --- a/code/modules/mob/living/silicon/robot/laws.dm +++ b/code/modules/mob/living/silicon/robot/laws.dm @@ -18,7 +18,7 @@ else lawsync() src << "Laws synced with AI, be sure to note any changes." - if (mind.special_role == "traitor" && mind.original == src) + if(mind && mind.special_role == "traitor" && mind.original == src) src << "Remember, your AI does NOT share or know about your law 0." else src << "No AI selected to sync laws with, disabling lawsync protocol." @@ -26,7 +26,7 @@ who << "Obey these laws:" laws.show_laws(who) - if ((mind.special_role == "traitor" && mind.original == src) && connected_ai) + if (mind && (mind.special_role == "traitor" && mind.original == src) && connected_ai) who << "Remember, [connected_ai.name] is technically your master, but your objective comes first." else if (connected_ai) who << "Remember, [connected_ai.name] is your master, other AIs can be ignored." diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 8522bf9b8c1..07afc79dafa 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -230,3 +230,14 @@ It's fairly easy to fix if dealing with single letters but not so much with comp if (M.real_name == text("[msg]")) return 1 return 0 + + +/mob/proc/abiotic(var/full_body = 0) + if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask))) + return 1 + + if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract ))) + return 1 + + return 0 + diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index 6091a1dbec5..da096e22c26 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -1041,16 +1041,6 @@ datum build_path = "/obj/item/weapon/gun/energy/lasercannon" locked = 1 - shockgun - name = "Shock Gun" - desc = "Your opponent has just lost THE GAME." - id = "shockgun" - req_tech = list("combat" = 5, "materials" = 4, "powerstorage" = 3) - build_type = PROTOLATHE - materials = list("$metal" = 8000, "$silver" = 3000, "$gold" = 500) - build_path = "/obj/item/weapon/gun/energy/shockgun" - locked = 1 - decloner name = "Decloner" desc = "Your opponent will bubble into a messy pile of goop." @@ -1089,14 +1079,14 @@ datum materials = list("$metal" = 5000, "$glass" = 1000, "$uranium" = 1000, "$silver" = 1000) build_path = "/obj/item/weapon/gun/energy/largecrossbow" - freeze_gun - name = "Freeze Gun" - desc = "A gun that shoots supercooled hydrogen particles to drastically chill a target's body temperature." - id = "freeze_gun" + temp_gun + name = "Temperature Gun" + desc = "A gun that shoots temperature bullet energythings to change temperature."//Change it if you want + id = "temp_gun" req_tech = list("combat" = 3, "materials" = 4, "powerstorage" = 3, "magnets" = 2) build_type = PROTOLATHE materials = list("$metal" = 5000, "$glass" = 500, "$silver" = 3000) - build_path = "/obj/item/weapon/gun/energy/freeze" + build_path = "/obj/item/weapon/gun/energy/temperature" locked = 1 large_grenade