DBM - Deadly Boss Mods (DBM-Core)

DBM - Deadly Boss Mods (DBM-Core)

535M Downloads

Restarting variable timer as non-variable keeps it variable

emmericp opened this issue ยท 3 comments

commented

Reproducer:

foo = DBM:NewMod("Foo")
t = foo:NewCDTimer(123, "test")
t:Start("v20-30")
t:Start(50)

That should yield a normal 50 second timer but instead creates a 40-50 variable timer. If you add an explicit :Stop() between the calls it works as expected. If you restart it twice it also works.

commented

Should be fixed by b02995e

commented

Indeed, I left the newBar reuse untouched, and it caused the issue you're describing.
Adam's commit indeed fixed the issue by adding this:

newBar.varianceDuration = varianceDuration or 0
newBar.hasVariance = varianceMinTimer and true or false

However, this should also be added to keep the newBar data filled with all variance variables:

newBar.minTimer = varianceMinTimer or nil
commented

7d94c55
Can be closed