Attribute Problem

devomage

Member
I'm having a problem with attributes. I have a trigger that when I enter the trigger an attribute is changed to increase and decrease on exit. If I enter/exit the trigger several times it seems to increase the rate of increase each time. any suggestions?

this function is called each time enter/exit the trigger:

C#:
public void SetLeyRegen()
{
    if (m_Character.Profession != MS_ProfessionType.Arcanist) return;

    var Ley = m_AttributeManager.GetAttribute("Ley");

    //set to lock
    var autoUpdateAmount = 0f;
    var autoUpdateValueType = Opsive.UltimateCharacterController.Traits.Attribute.AutoUpdateValue.None;

    //Ley.CancelAutoUpdate();

    if (!m_Character.IsLeyLocked)
    {
        autoUpdateAmount = LeyPerRegen;

        if (m_Character.InPool)
        {
            autoUpdateValueType = Opsive.UltimateCharacterController.Traits.Attribute.AutoUpdateValue.Increase;
        }
        else
        {
            autoUpdateValueType = Opsive.UltimateCharacterController.Traits.Attribute.AutoUpdateValue.Decrease;
        }
    }

    Ley.AutoUpdateAmount = autoUpdateAmount;
    Ley.AutoUpdateInterval = AutoUpdateInterval;
    Ley.AutoUpdateStartDelay = 0;
    Ley.AutoUpdateValueType = autoUpdateValueType;
}
 
Thanks for letting me know. I was able to reproduce this and you can fix it by changing line 108 of AttributeManager from:

Code:
m_AutoUpdateEvent = Scheduler.Schedule(m_AutoUpdateStartDelay, UpdateValue);
to:
Code:
m_AutoUpdateEvent = Scheduler.Schedule(m_AutoUpdateInterval, UpdateValue);
 
Top