From 18dfa26419152f6790018971f95c446eccce570d Mon Sep 17 00:00:00 2001 From: AnturK Date: Tue, 19 May 2015 18:15:47 +0200 Subject: [PATCH] Fixes renamed wielded items reverting to inital name --- code/game/objects/items/weapons/twohanded.dm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 1eb1666ab39..e86736fbef4 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -31,7 +31,11 @@ if(!wielded || !user) return wielded = 0 force = force_unwielded - name = "[initial(name)]" + var/sf = findtext(name," (Wielded)") + if(sf) + name = copytext(name,1,sf) + else //something wrong + name = "[initial(name)]" update_icon() user << "You are now carrying the [name] with one hand." if(unwieldsound) @@ -51,21 +55,21 @@ return wielded = 1 force = force_wielded - name = "[initial(name)] (Wielded)" + name = "[name] (Wielded)" update_icon() - user << "You grab the [initial(name)] with both hands." + user << "You grab the [name] with both hands." if (wieldsound) playsound(loc, wieldsound, 50, 1) var/obj/item/weapon/twohanded/offhand/O = new(user) ////Let's reserve his other hand~ - O.name = "[initial(name)] - offhand" - O.desc = "Your second grip on the [initial(name)]" + O.name = "[name] - offhand" + O.desc = "Your second grip on the [name]" user.put_in_inactive_hand(O) return /obj/item/weapon/twohanded/mob_can_equip(M as mob, slot) //Cannot equip wielded items. if(wielded) - M << "Unwield the [initial(name)] first!" + M << "Unwield the [name] first!" return 0 return ..()