SupSuper/OpenXcom — pull request #900 by myk002 (2014-07-15 23:33:30+00:00)
Title: Copy paste primed items

sets the fuse timer when templates are applied and refreshes the sprite in all cases when grenades are primed/unprimed (before, the sprite was only refreshed when priming a grenade that had an explicit timer to set)

Fixes issue http://openxcom.org/bugs/openxcom/issues/763

Some notes:
1) grenades are not unconditionally unprimed (or otherwise reset to some original state) if the inventory is cleared, either with the 'x' hotkey or by applying a template over an existing non-empty inventory. In the worst case, a user could apply a template with primed grenades to all the units, then go through and 'x' all the units' inventories. The ground will be full of primed grenades even if they were all originally unprimed. This pull request includes a fix to update the sprite of a grenade immediately when it is unprimed, so whereas before you'd have to r-click a primed grenade to unprime it, click on it to pick it up, and then drop it to update the sprite, now you can just r-click and have the sprite updated and have the grenade stack with other unprimed grenades of the same type, so even if this happens, it actually doesn't take too long to "fix". the user could also just create a template with grenades primed/unprimed as desired and apply that template to other units, which would set the fuse timers appropriately too.

2) when grenades are primed/unprimed, I call arrangeGround to update the sprites. This is consistent with what is currently done for grenades that are primed via the 'select timer' popup. People may prefer the grenade to be automaticaly picked up as if it were l-clicked. We'll have to see if anyone brings this up as an issue.