Skip to content

OnTick callback issue in ClickerManager #3

@supratikbanerjee

Description

@supratikbanerjee
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions