mustachebutter / GodotAutoSurvival

0 stars 0 forks source link

[BUG] Debuff doesn't get refreshed when hit with multiple projectiles #17

Closed mustachebutter closed 4 months ago

mustachebutter commented 5 months ago

Describe the bug It might get refreshed but the OnStatusEffectEnd() in DotStatusEffect class is called for the same amount as the time that it refreshes.

To Reproduce Steps to reproduce the behavior:

  1. Shoot multiple fireballs on the same target (let's say 2)
  2. Observe that there will be 2 instances of damage number being applied at the same time (meaning 2 debuffs on the target)

Expected behavior Observe the debug window, it will print out the debug line in OnStatusEffectEnd twice, which should only be once.

Screenshots image

mustachebutter commented 4 months ago

When the status effect ends and tick timer being destroyed. It shoudn't be empty, but it is complaining that the variable _tickTimer is null image

mustachebutter commented 4 months ago

Fixed. It is fixed by calling the StartMainTimer() to refresh the timer of the old same instance of status effect on the target. Previously it would called the method from a new instance of the status effect coming in, which doesn't properly resets it.