Is it shield?

raorn

Member
How do I know if given item is shield? Or not "generic" item, but equipped off-hand item. weapon_type() returns empty string (BTW, can it return "unknown"?) for both shields an other off-hands. Is this code correct:

item offhand = equipped_item($slot[off-hand]);
if (offhand.weapon_type() == "" && (offhand.get_power() > 0 || offhand == $item[polyalloy shield]))
// shield
 
Top