Skip to content

Commit

Permalink
Fixes icon updating for rods
Browse files Browse the repository at this point in the history
  • Loading branch information
Menshin committed Feb 7, 2015
1 parent b936324 commit 47ec0bb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions code/game/objects/items/stacks/rods.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ var/global/list/datum/stack_recipe/rod_recipes = list ( \
hitsound = 'sound/weapons/grenadelaunch.ogg'

/obj/item/stack/rods/New(var/loc, var/amount=null)
..()

recipes = rod_recipes
update_icon()
return ..()

/obj/item/stack/rods/update_icon()
if(get_amount() <= 5)
icon_state = "rods-[get_amount()]"
var/amount = get_amount()
if((amount <= 5) && (amount > 0))
icon_state = "rods-[amount]"
else
icon_state = "rods"

Expand Down Expand Up @@ -58,4 +60,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list ( \
/obj/item/stack/rods/cyborg/
m_amt = 0
is_cyborg = 1
cost = 250
cost = 250

/obj/item/stack/rods/cyborg/update_icon()
return

0 comments on commit 47ec0bb

Please sign in to comment.