uClicker icon indicating copy to clipboard operation
uClicker copied to clipboard

OnTick callback issue in ClickerManager

Open supratikbanerjee opened this issue 2 years ago • 0 comments

public void Tick()
{
    bool updated = false;
    foreach (Currency currency in Config.Currencies)
    {
        float amount = PerSecondAmount(currency);

        updated = UpdateTotal(currency, amount);
    }

    UpdateUnlocks();
    if (updated)
    {
        OnTick.Invoke();
    }
}

Isn't the updated bool incorrectly assigned in the loop? If the last currency in an iteration isn't updated, it'll render no calls to OnTick events.

supratikbanerjee avatar Nov 13 '22 16:11 supratikbanerjee