Bug with Currency in Ultimate Inventory System
Posted: Mon Sep 02, 2024 8:04 pm
Hello Tony,
I’m always asking questions, so this time I wanted to contribute my bit. I found a bug where the concurrency is not counted when it's a condition to fulfill a mission node. I was looking into the code of UISCurrencyAmountQuestCondition.cs and found that m_currencyOwner was not assigned a value, so I made the change:
m_currencyOwner = UISUtility.GetCurrencyOwner(StringField.GetStringValue(currencyOwnerName));
This fixed one error, but it still wasn't updating in real time. The event was not properly defined:
Original:
Opsive.Shared.Events.EventHandler.RegisterEvent(EventNames.c_CurrencyCollection_OnUpdate, OnCurrencyChange);
Corrected:
Opsive.Shared.Events.EventHandler.RegisterEvent(m_currencyOwner, EventNames.c_CurrencyOwner_OnUpdate, OnCurrencyChange);
Best regards,
Claudio
I’m always asking questions, so this time I wanted to contribute my bit. I found a bug where the concurrency is not counted when it's a condition to fulfill a mission node. I was looking into the code of UISCurrencyAmountQuestCondition.cs and found that m_currencyOwner was not assigned a value, so I made the change:
m_currencyOwner = UISUtility.GetCurrencyOwner(StringField.GetStringValue(currencyOwnerName));
This fixed one error, but it still wasn't updating in real time. The event was not properly defined:
Original:
Opsive.Shared.Events.EventHandler.RegisterEvent(EventNames.c_CurrencyCollection_OnUpdate, OnCurrencyChange);
Corrected:
Opsive.Shared.Events.EventHandler.RegisterEvent(m_currencyOwner, EventNames.c_CurrencyOwner_OnUpdate, OnCurrencyChange);
Best regards,
Claudio