(HS2) Fix the ChaControl.UpdateWet NullReferenceException #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.