Skip to content

Commit

Permalink
Fix rounding in beam damage calculation (FAForever#6201)
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 authored May 21, 2024
1 parent a91e9f3 commit b97bdc6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion changelog/snippets/fix.6115.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- (#6115) Fix damage calculation in the unit view UI for beam weapons with a `BeamCollisionDelay` such as the Zapper's weapon.
- (#6115, #6201) Fix damage calculation in the unit view UI for beam weapons with a `BeamCollisionDelay` such as the Zapper's weapon.
2 changes: 1 addition & 1 deletion lua/ui/game/unitviewDetail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ function WrapAndPlaceText(bp, builder, descID, control)
Damage = math.max(Damage, info.DamageToShields)
end
if info.BeamLifetime > 0 then
Damage = Damage * (1 + MathFloor(MATH_IRound(info.BeamLifetime)/(info.BeamCollisionDelay+0.1)))
Damage = Damage * (1 + MathFloor(MATH_IRound(info.BeamLifetime*10)/(MATH_IRound(info.BeamCollisionDelay*10)+1)))
else
Damage = Damage * (info.DoTPulses or 1) + (info.InitialDamage or 0)
local ProjectilePhysics = __blueprints[info.ProjectileId].Physics
Expand Down
2 changes: 1 addition & 1 deletion units/DSLK004/DSLK004_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ UnitBlueprint{
},
AutoInitiateAttackCommand = false,
BallisticArc = "RULEUBA_None",
BeamCollisionDelay = 0.01,
BeamCollisionDelay = 0,
BeamLifetime = 0.6,
CannotAttackGround = true,
CollideFriendly = false,
Expand Down

0 comments on commit b97bdc6

Please sign in to comment.