Issue Data
|
Issue #29321: hc_managerscript - Cannot call show() on a None object (EffectMessageToShow check needed)
This is continue of "Issue #20606: hc_managerscript - Cannot call show() on a None object".
Summary: The value of EffectMessageToShow could be None because it can be unset dynamically, but the comparison against the PreviousEffectMessageToShow does not taking into account this fact. Currently the stack trace is looks like this: [10/02/2020 - 04:44:06AM] error: Cannot call Show() on a None object, aborting function call stack: [HC_Manager (0000080E)].hardcore:hc_managerscript.ApplyEffect() - "C:\Users\JD\AppData\Local\Temp\PapyrusTemp\Hardcore\HC_ManagerScript.psc" Line 929 [HC_Manager (0000080E)].hardcore:hc_managerscript.HandleSleepDeprivationTimer() - "C:\Users\JD\AppData\Local\Temp\PapyrusTemp\Hardcore\HC_ManagerScript.psc" Line 2963 [HC_Manager (0000080E)].hardcore:hc_managerscript.OnTimerGameTime() - "C:\Users\JD\AppData\Local\Temp\PapyrusTemp\Hardcore\HC_ManagerScript.psc" Line 466 [10/02/2020 - 04:44:06AM] warning: Assigning None to a non-object variable named "::temp231" stack: [HC_Manager (0000080E)].hardcore:hc_managerscript.ApplyEffect() - "C:\Users\JD\AppData\Local\Temp\PapyrusTemp\Hardcore\HC_ManagerScript.psc" Line 929 [HC_Manager (0000080E)].hardcore:hc_managerscript.HandleSleepDeprivationTimer() - "C:\Users\JD\AppData\Local\Temp\PapyrusTemp\Hardcore\HC_ManagerScript.psc" Line 2963 [HC_Manager (0000080E)].hardcore:hc_managerscript.OnTimerGameTime() - "C:\Users\JD\AppData\Local\Temp\PapyrusTemp\Hardcore\HC_ManagerScript.psc" Line 466 Possible fix: ; There has been no change... nothing to see here. ;UFO4P 1.0.3 Bug #20606 - Guys, there was something to see here after all :P if IncrementEffectBy > 0 && newVal == oldVal EffectMessageToShow = none elseif bDisplayMessage && EffectMessageToShow != PreviousEffectMessageToShow if EffectMessageToShow != none EffectMessageToShow.show() elseif PreviousEffectMessageToShow != none PreviousEffectMessageToShow.show() PreviousEffectMessageToShow = None ; XXX: is it correct? endif endif |