Fix hit chance calculation for Fist Weapons. Patch by krz
--HG-- branch : trunk
This commit is contained in:
+6
-2
@@ -5315,6 +5315,9 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step)
|
||||
if(!skill_id)
|
||||
return false;
|
||||
|
||||
if(skill_id == SKILL_FIST_WEAPONS)
|
||||
skill_id = SKILL_UNARMED;
|
||||
|
||||
uint16 i=0;
|
||||
for (; i < PLAYER_MAX_SKILLS; i++)
|
||||
if ((GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF) == skill_id)
|
||||
@@ -5519,7 +5522,7 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType)
|
||||
{
|
||||
Item *tmpitem = GetWeaponForAttack(attType,true);
|
||||
if (tmpitem)
|
||||
UpdateSkill(tmpitem->GetSkill(),weapon_skill_gain);
|
||||
UpdateSkill(tmpitem->GetSkill(), weapon_skill_gain);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -20352,8 +20355,9 @@ uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const
|
||||
if(attType != BASE_ATTACK && !item)
|
||||
return 0;
|
||||
|
||||
// weapon skill or (unarmed for base attack)
|
||||
// weapon skill or (unarmed for base attack and for fist weapons)
|
||||
uint32 skill = item ? item->GetSkill() : uint32(SKILL_UNARMED);
|
||||
uint32 skill = (item && item->GetSkill() != SKILL_FIST_WEAPONS) ? item->GetSkill() : uint32(SKILL_UNARMED);
|
||||
return GetBaseSkillValue(skill);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user