Fix dual-wield damage calculation
When a player dual-wields a sword and a mace, the damage calculation against certain monster types is incorrect. The code that determines the weapon type for applying damage modifiers gives precedence to maces over swords, regardless of which hand they are in. This is because it checks for a sword first, then checks for a mace and overwrites the weapon type. This behavior is arbitrary and likely unintended, leading to inconsistent and unpredictable damage output.
This commit modifies the weapon-type detection logic to prioritize the weapon in the player's right hand (INVLOC_HAND_RIGHT), which is conventionally the main hand. If the right hand doesn't hold a sword or mace, the code will then check the left hand. This change will make the damage calculation predictable and logical when dual-wielding.
A new test case has been added to test/player_test.cpp to verify the fix. The test creates a player dual-wielding a sword and a mace and confirms that the damage modifier against an Undead monster is correctly based on the main-hand weapon.
This commit modifies the weapon-type detection logic to prioritize the weapon in the player's right hand (INVLOC_HAND_RIGHT), which is conventionally the main hand.
Conventionally, most players use the left hand as the main hand. This is established even in beginning character loadouts, as seen on the Warrior and Barbarian.