IllusionMods / IllusionFixes

A collection of fixes for common issues found in games by Illusion
GNU General Public License v3.0
157 stars 29 forks source link

(HS2) Fix the ChaControl.UpdateWet NullReferenceException #25

Closed OrangeSpork closed 3 years ago

OrangeSpork commented 3 years ago

This tends to happen with some mods ported from AIS, they have CmpHair or CmpClothes MB setups with a null renderer in the array. Most of Illusion code handles this but the ChaControl.UpdateWet doesn't handle the NullReference and spams the following error per frame:

NullReferenceException: Object reference not set to an instance of an object at AIChara.ChaControl.UpdateWet () [0x001b5] in :0 at AIChara.ChaControl.UpdateForce () [0x0001f] in :0 at Manager.Character.Update () [0x00026] in :0

This fix simply scans for and removes null renderers from the renderer array, thus fixing the not fully applied wet effects and more importantly the performance hit on the constant log spam.

ManlyMarco commented 3 years ago

Looks good, thank you!