Skip to content

Handle running stats extensions on non-actors gracefully (#7770)

Alexei Kotov requested to merge Capostrophic/openmw:ondeath into master

Fixes #7770 (closed). I think at this point we have a pretty good idea that Morrowind usually doesn't particularly care when a script does something that can't meaningfully work on the reference and quietly does nothing or returns 0. This extends the few exceptions we already had for some stats extensions to all stats extensions (I did something similar for AI extensions a while ago).
Of particular note is GetLevel, which does return a non-zero value for non-actors. It's always -1.
The mod itself uses OnDeath in a script that's used for both actors and non-actors. Presumably Morrowind just handles OnDeath as 0 in comparisons and can manage to disable the involved objects properly.

Merge request reports

Loading