Build #103: Weapons breaking can throw exception

Report specific bugs in Daggerfall Unity. Please read guidelines before posting.
Post Reply
User avatar
Posts: 590
Joined: Sat Aug 26, 2017 2:46 pm

Build #103: Weapons breaking can throw exception

Post by Hazelnut » Sat Mar 24, 2018 7:39 pm

WHen a bow breaks and is auto-unequipped, FPSWeapon.Update() can throw an index out of range exception which prevents and further use of weapons. I assume this happens with other weapons, but only seen it with bows because they break so quickly. I had a quick look and don't feel I know enough about this code to fix it correctly. I think it depends on where the animation is since is a coroutine, so it doesn't always happen.

Code: Select all

IndexOutOfRangeException: Array index is out of range.
DaggerfallWorkshop.Game.FPSWeapon.UpdateWeapon () (at Assets/Scripts/Game/FPSWeapon.cs:239)
DaggerfallWorkshop.Game.FPSWeapon+<AnimateWeapon>c__Iterator0.MoveNext () (at Assets/Scripts/Game/FPSWeapon.cs:398)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

User avatar
Posts: 2972
Joined: Sun Mar 22, 2015 1:51 am

Re: Build #103: Weapons breaking can throw exception

Post by Interkarma » Sat Mar 24, 2018 10:13 pm

Thanks for the report. :)

Post Reply