From 437841d8b418d7094b54ea939b99b803f64af8b3 Mon Sep 17 00:00:00 2001 From: "aranclanos@hotmail.com" Date: Wed, 7 Nov 2012 21:08:03 +0000 Subject: [PATCH] Fixes Issue 1081 - Not being able to analyze tanks with PDA/analyzers. The tank attackby proc was overridden by the one tank bombs. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5025 316c924e-a436-60f5-8080-3fe189b3f50e --- .../game/objects/items/weapons/tanks/tanks.dm | 6 ++- code/modules/assembly/bomb.dm | 44 +++++++++---------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 248117a534..bab4cff703 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -77,10 +77,11 @@ /obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() var/obj/icon = src + if (istype(src.loc, /obj/item/assembly)) icon = src.loc - if ((istype(W, /obj/item/device/analyzer) || (istype(W, /obj/item/device/pda))) && get_dist(user, src) <= 1) + if ((istype(W, /obj/item/device/analyzer) || (istype(W, /obj/item/device/pda))) && get_dist(user, src) <= 1) for (var/mob/O in viewers(user, null)) O << "\red [user] has used [W] on \icon[icon] [src]" @@ -112,8 +113,9 @@ var/obj/item/latexballon/LB = W LB.blow(src) src.add_fingerprint(user) - return + if(istype(W, /obj/item/device/assembly_holder)) + bomb_assemble(W,user) /obj/item/weapon/tank/attack_self(mob/user as mob) if (!(src.air_contents)) diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index db4e550d6a..ca04edd7a4 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -75,29 +75,29 @@ // ---------- Procs below are for tanks that are used exclusively in 1-tank bombs ---------- -/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob) //Bomb assembly proc. This turns assembly+tank into a bomb - if(istype(W, /obj/item/device/assembly_holder)) - var/obj/item/device/assembly_holder/S = W - if(!S.secured) //Check if the assembly is secured - return - if(isigniter(S.a_left) == isigniter(S.a_right)) //Check if either part of the assembly has an igniter, but if both parts are igniters, then fuck it - return - - var/obj/item/device/onetankbomb/R = new /obj/item/device/onetankbomb(loc) - - user.drop_item() //Remove the assembly from your hands - user.remove_from_mob(src) //Remove the tank from your character,in case you were holding it - user.put_in_hands(R) //Equips the bomb if possible, or puts it on the floor. - - R.bombassembly = S //Tell the bomb about its assembly part - S.master = R //Tell the assembly about its new owner - S.loc = R //Move the assembly out of the fucking way - - R.bombtank = src //Same for tank - master = R - loc = R - R.update_icon() +/obj/item/weapon/tank/proc/bomb_assemble(W,user) //Bomb assembly proc. This turns assembly+tank into a bomb + var/obj/item/device/assembly_holder/S = W + var/mob/M = user + if(!S.secured) //Check if the assembly is secured return + if(isigniter(S.a_left) == isigniter(S.a_right)) //Check if either part of the assembly has an igniter, but if both parts are igniters, then fuck it + return + + var/obj/item/device/onetankbomb/R = new /obj/item/device/onetankbomb(loc) + + M.drop_item() //Remove the assembly from your hands + M.remove_from_mob(src) //Remove the tank from your character,in case you were holding it + M.put_in_hands(R) //Equips the bomb if possible, or puts it on the floor. + + R.bombassembly = S //Tell the bomb about its assembly part + S.master = R //Tell the assembly about its new owner + S.loc = R //Move the assembly out of the fucking way + + R.bombtank = src //Same for tank + master = R + loc = R + R.update_icon() + return /obj/item/weapon/tank/proc/ignite() //This happens when a bomb is told to explode var/fuel_moles = air_contents.toxins + air_contents.oxygen/6