EliotVU / Unreal-Library

UnrealScript decompiler library for Unreal package files (.upk, .u, .uasset; etc), with support for Unreal Engine 1, 2, and 3
MIT License
367 stars 86 forks source link

InvalidOperation when decompiling the defaultproperties of an array of bools #59

Closed EliotVU closed 1 year ago

EliotVU commented 1 year ago

Original code:

    BoolArray(0)=true
    BoolArray(1)=false

Decompilation output:

    BoolArray(0)=
/* Exception thrown while deserializing BoolArray
System.InvalidOperationException: Object waarvoor null is toegestaan, moet een waarde hebben.
   bij System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   bij UELib.Core.UDefaultProperty.DeserializeDefaultPropertyValue(PropertyType type, DeserializeFlags& deserializeFlags) */
    BoolArray(1)=
/* Exception thrown while deserializing BoolArray
System.InvalidOperationException: Object waarvoor null is toegestaan, moet een waarde hebben.
   bij System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   bij UELib.Core.UDefaultProperty.DeserializeDefaultPropertyValue(PropertyType type, DeserializeFlags& deserializeFlags) */

Cause: UE1, UE2 do not support an array of bools, but as of UE3 this had been supported, however the decompiler still assumes the UE2 behavior.