fix(Core/Player) internally handle expertise as float (#21967)

The core will no longer truncated the expertise (from float to int) value on the server side.
This commit is contained in:
Tereneckla 2025-04-26 18:37:05 +00:00 committed by GitHub
parent c1d42d2c36
commit 7503a24266
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View file

@ -879,7 +879,7 @@ void Player::UpdateExpertise(WeaponAttackType attack)
if (attack == RANGED_ATTACK)
return;
int32 expertise = int32(GetRatingBonusValue(CR_EXPERTISE));
float expertise = GetRatingBonusValue(CR_EXPERTISE);
Item* weapon = GetWeaponForAttack(attack, true);
@ -900,10 +900,12 @@ void Player::UpdateExpertise(WeaponAttackType attack)
switch (attack)
{
case BASE_ATTACK:
SetUInt32Value(PLAYER_EXPERTISE, expertise);
m_Expertise = expertise;
SetUInt32Value(PLAYER_EXPERTISE, int32(expertise));
break;
case OFF_ATTACK:
SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, expertise);
m_OffhandExpertise = expertise;
SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, int32(expertise));
break;
default:
break;