From b6b3204bf78866a41e7740a4b34356c1e7c1e2c2 Mon Sep 17 00:00:00 2001 From: Spacemanspark Date: Tue, 9 Feb 2016 01:02:25 -0600 Subject: [PATCH] Makes Mob Capsule code better. --- code/game/objects/items/weapons/storage/belt.dm | 6 +++--- code/modules/mining/mine_items.dm | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 0855fd73491..44b1a21f73d 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -250,12 +250,12 @@ /obj/item/weapon/storage/belt/lazarus name = "trainer's belt" - desc = "For the pokemo- mining master, holds your lazarus capsules." + desc = "For the mining master, holds your lazarus capsules." icon_state = "lazarusbelt" item_state = "lazbelt" w_class = 4 - max_w_class = 4 - max_combined_w_class = 28 + max_w_class = 1 + max_combined_w_class = 6 storage_slots = 6 can_hold = list("/obj/item/device/mobcapsule") diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index d44b7d5a0da..5a0c256f318 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -201,9 +201,15 @@ icon_state = "mobcap0" w_class = 1.0 throw_range = 20 - var/mob/living/captured = null + var/mob/living/simple_animal/captured = null var/colorindex = 0 +/obj/item/device/mobcapsule/Destroy() + if(captured) + qdel(captured) + captured = null + return ..() + /obj/item/device/mobcapsule/attack(var/atom/A, mob/user, prox_flag) if(!istype(A, /mob/living/simple_animal)) return ..() @@ -214,7 +220,6 @@ var/mob/living/simple_animal/T = target if(captured) U << "Capture failed!: The capsule already has a mob registered to it!" - return else if(istype(T) && "neutral" in T.faction) T.forceMove(src) @@ -233,7 +238,7 @@ /obj/item/device/mobcapsule/proc/dump_contents(mob/user) if(captured) - captured.loc = src.loc + captured.forceMove(get_turf(src)) if(captured.client) captured.client.eye = captured.client.mob captured.client.perspective = MOB_PERSPECTIVE