Core/Units: fixed initializing stat multipliers and displaying positive and negative mods
This commit is contained in:
1 parent
906c4ed081
commit
d0b0f35a42
2 files changed
+3
-4
No files matched your search
@@ -27,7 +27,7 @@ Stats::Stats(Unit* owner) : _owner(owner), _baseStats({ }), _baseStatModifiers({
|
|||||||
_totalModifiers({ }), _totalPctMultipliers({ })
|
_totalModifiers({ }), _totalPctMultipliers({ })
|
||||||
{
|
{
|
||||||
_basePctMultipliers.fill(1.0);
|
_basePctMultipliers.fill(1.0);
|
||||||
_totalModifiers.fill(1.0);
|
_totalPctMultipliers.fill(1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the unmodified base value of the specified stat.
|
/// Returns the unmodified base value of the specified stat.
|
||||||
@@ -255,7 +255,7 @@ void Stats::updateStat(StatType statType)
|
|||||||
if (totalValue < statValue)
|
if (totalValue < statValue)
|
||||||
posStatValue += statValue - totalValue;
|
posStatValue += statValue - totalValue;
|
||||||
else
|
else
|
||||||
negStatValue += statValue - totalValue;
|
negStatValue += totalValue - statValue;
|
||||||
|
|
||||||
// ==== Apply the stats
|
// ==== Apply the stats
|
||||||
_owner->SetInt32Value(UNIT_FIELD_STAT0 + AsUnderlyingType(statType), statValue);
|
_owner->SetInt32Value(UNIT_FIELD_STAT0 + AsUnderlyingType(statType), statValue);
|
||||||
|
|||||||
@@ -13631,8 +13631,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
|||||||
// there are some float values which may be negative or can't get negative due to other checks
|
// there are some float values which may be negative or can't get negative due to other checks
|
||||||
else if ((index >= UNIT_FIELD_NEGSTAT0 && index <= UNIT_FIELD_NEGSTAT4) ||
|
else if ((index >= UNIT_FIELD_NEGSTAT0 && index <= UNIT_FIELD_NEGSTAT4) ||
|
||||||
(index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + 6)) ||
|
(index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + 6)) ||
|
||||||
(index >= UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + 6)) ||
|
(index >= UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + 6)))
|
||||||
(index >= UNIT_FIELD_POSSTAT0 && index <= UNIT_FIELD_POSSTAT4))
|
|
||||||
{
|
{
|
||||||
fieldBuffer << uint32(m_floatValues[index]);
|
fieldBuffer << uint32(m_floatValues[index]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user