From fff5ea78400efc785e477791d79f2bcfb708a486 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Thu, 7 May 2015 13:11:25 +0200 Subject: [PATCH] Grabs no longer endless loop runtime. --- code/modules/mob/inventory.dm | 2 +- code/modules/mob/living/bot/cleanbot.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 6 +++--- code/modules/mob/mob_grab.dm | 12 ++++++------ code/modules/nano/modules/law_manager.dm | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 5a5e7d1044..55232be0f6 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -155,7 +155,7 @@ var/list/slot_equipment_priority = list( \ Target = loc remove_from_mob(W) - if(!W) return 1 // self destroying objects (tk, grabs) + if(!(W && W.loc)) return 1 // self destroying objects (tk, grabs) W.forceMove(Target) update_icons() diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm index fa28343547..7331010852 100644 --- a/code/modules/mob/living/bot/cleanbot.dm +++ b/code/modules/mob/living/bot/cleanbot.dm @@ -226,7 +226,7 @@ beacon_freq = freq if("screw") screwloose = !screwloose - usr << "You twiddle the screw." if("oddbutton") oddbutton = !oddbutton usr << "You press the weird button." diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 881cb2d76a..ab2bc3d98c 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -277,9 +277,9 @@ qdel(MED) for(var/mob/M in viewers(src, null)) if ((M.client && !( M.blinded ))) - M.show_message("[user] applies the [MED] on [src].") else - user << "" + user << "\The [src] is dead, medical items won't bring it back to life." if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead. if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch)) harvest(user) @@ -300,7 +300,7 @@ usr << "[user] gently taps [src] with the [O].") + M.show_message("[user] gently taps [src] with \the [O].") /mob/living/simple_animal/movement_delay() var/tally = 0 //Incase I need to add stuff other than "speed" later diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 73c5ee1de7..d10e7f1863 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -24,7 +24,7 @@ assailant = user affecting = victim - if(affecting.anchored) + if(affecting.anchored || !assailant.Adjacent(victim)) qdel(src) return @@ -36,7 +36,6 @@ hud.master = src /obj/item/weapon/grab/Destroy() - //make sure the grabbed_by list doesn't fill up with nulls if(affecting) affecting.grabbed_by -= src affecting = null @@ -45,6 +44,7 @@ assailant.client.screen -= hud assailant = null qdel(hud) + hud = null ..() //Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code. @@ -68,6 +68,9 @@ /obj/item/weapon/grab/process() confirm() + if(!assailant) + qdel(src) + return if(assailant.client) assailant.client.screen -= hud @@ -227,8 +230,5 @@ /obj/item/weapon/grab/dropped() + loc = null qdel(src) - -/obj/item/weapon/grab/Destroy() - qdel(hud) - ..() diff --git a/code/modules/nano/modules/law_manager.dm b/code/modules/nano/modules/law_manager.dm index 7cdd93b4dc..93caa4c48b 100644 --- a/code/modules/nano/modules/law_manager.dm +++ b/code/modules/nano/modules/law_manager.dm @@ -147,7 +147,7 @@ R << "Law Notice" R.laws.show_laws(R) if(usr != owner) - usr << "Laws displayed." return 1 return 0