I'm having some scripting problem. I need to check, if OBJECT_SELF is wielding only one one-handed weapon (in his right hand, obviously). How can this be achieved? I'm trying to do this for K1 to specify.
I tried this variant
object leftweapon = GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON , OBJECT_SELF);
if (!GetIsObjectValid (leftweapon))
// no weapon in left hand
object rightweapon = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, OBJECT_SELF);
if (GetIsObjectValid (rightweapon))
// some weapon in right hand; added in order to block bonuses for unarmed combat
<additional code; not related to the problem>
While it does work correctly for two one-handed weapons (i.e. 2 blasters) and for one one-handed weapon (i.e. blaster), it treats all two-handed weapons (i.e. blaster rifle) as one-handed.