Page 1 of 1

[0.10.27] NullReferenceException with DaggerfallMissile

Posted: Tue Oct 20, 2020 3:34 am
by jefetienne
While working on a mod, I stumbled upon a runtime error whenever the player steps or clicks on one of the MultiTrigger levers in the final dungeon.

Steps to reproduce:

1. Load attached save
2. Step or click on lever in front of player
3. Observe Error

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
DaggerfallWorkshop.Game.DaggerfallMissile.DoTouch () (at Assets/Scripts/Game/DaggerfallMissile.cs:406)
DaggerfallWorkshop.Game.DaggerfallMissile.Update () (at Assets/Scripts/Game/DaggerfallMissile.cs:258)
If you step/click on the lever behind you, it will work fine because it is CasterOnly, wheras the one giving the error is ByTouch.

I tracked down where this is all coming from: The 'caster' in DaggerfallMissile is set to null in the Start() method because the payload.CasterEntityBehaviour is null. The payload gets created under DaggerfallAction.CastSpell(), but the CasterEntityBehaviour is unassigned. I think a simple fix would just be to simply set it to the PlayerEntityBehavior in the CastSpell method, but would a better fix be to set it as whatever stepped on it? If the latter, I'm not sure how much reworking that would entail.

Re: [0.10.27] NullReferenceException with DaggerfallMissile [RESOLVED 0.10.28]

Posted: Mon Oct 26, 2020 12:28 am
by Interkarma
Thank you jefetienne! :) Have merged a fix for this one now.

https://github.com/Interkarma/daggerfal ... 98ee509649