I am aware that the Fast Shot trait gives you a "hidden" bonus of +5 to total damage per attack. Likewise, Heavy Handed gives you a "hidden" +2 to damage with unarmed attacks. However, in the same conditional this piece of code remains:
if(attack.Attacker.Trait[TRAIT_ONE_HANDER] != 0 && (!valid(realWeapon) || FLAG(realWeapon.Flags, ITEM_TWO_HANDS)))
totalDmg += 5;
It appears what this was aiming for was for one handed weapons to give another "hidden" +5 bonus to damage per attack - but the condition suggests the opposite. For example, I rolled a character with both Fast Shot and One Hander with the intention of making a one-handed gunslinger, but when I used the BB gun against the rats in the tent quest, I was doing an abnormally high amount of damage. Later I confirmed this on a bluesuit with no toughness perks that the BB gun with a base damage of 8-13 and no ammo modifiers was doing 18-23 damage purely from the two traits. The -40% accuracy hit was still in place.
TL;DR, the +5 damage bonus intended for One Hander users applies to two-handed weapons only, and this strikes me as a bug. Might I suggest a strategically placed exclamation point?