Fixes renamed wielded items reverting to inital name

This commit is contained in:
AnturK
2015-05-19 18:15:47 +02:00
parent 2d6e01b547
commit 18dfa26419
+10 -6
View File
@@ -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 << "<span class='notice'>You are now carrying the [name] with one hand.</span>"
if(unwieldsound)
@@ -51,21 +55,21 @@
return
wielded = 1
force = force_wielded
name = "[initial(name)] (Wielded)"
name = "[name] (Wielded)"
update_icon()
user << "<span class='notice'>You grab the [initial(name)] with both hands.</span>"
user << "<span class='notice'>You grab the [name] with both hands.</span>"
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 << "<span class='warning'>Unwield the [initial(name)] first!</span>"
M << "<span class='warning'>Unwield the [name] first!</span>"
return 0
return ..()