[Bug] Quest node conditions don't stop checking when node is set to inactive
Posted: Thu Mar 02, 2023 11:43 am
I have a quest setup detailed in this thread: https://www.pixelcrushers.com/phpbb/vie ... f=9&t=6747
After fixing the issue in that thread, however, I noticed that the quest can skip to the "win" node being true (and then on to the Success node) after the first time the player loses. After some digging, I realized this was because the lua condition the "win" node checks for never stops checking after the node is set to Inactive. I think this is because QuestConditionSet.ResetConditions() is called before StopChecking() when the node state changes to Inactive. Because ResetConditions sets m_isChecking to false, StopChecking returns out as soon as it is called, based on the if ... return block at the top.
My fix is to call StopChecking at the very top of ResetConditions if m_isChecking is true.
This seems to fix my issue but please let me know if there are any unintentional side effects this change could cause!
After fixing the issue in that thread, however, I noticed that the quest can skip to the "win" node being true (and then on to the Success node) after the first time the player loses. After some digging, I realized this was because the lua condition the "win" node checks for never stops checking after the node is set to Inactive. I think this is because QuestConditionSet.ResetConditions() is called before StopChecking() when the node state changes to Inactive. Because ResetConditions sets m_isChecking to false, StopChecking returns out as soon as it is called, based on the if ... return block at the top.
My fix is to call StopChecking at the very top of ResetConditions if m_isChecking is true.
This seems to fix my issue but please let me know if there are any unintentional side effects this change could cause!