mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Shared/Utils: Fixed ApplyPercentModFloatVar.
This has been around since 2010-12-11 :)
This commit is contained in:
@@ -114,7 +114,8 @@ inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
|
||||
{
|
||||
if (val == -100.0f) // prevent set var to zero
|
||||
val = -99.99f;
|
||||
var *= (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val));
|
||||
|
||||
var *= apply ? (100.0f + val) / 100.0f : (100.0f - val) / 100.0f;
|
||||
}
|
||||
|
||||
// Percentage calculation
|
||||
|
||||
Reference in New Issue
Block a user