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)
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.