Querijn / LeagueModel

A League of Legends Model Viewer
MIT License
26 stars 4 forks source link

An exception occurs while parsing "Aatrox.wad.client" #19

Closed JohnYoung404 closed 4 years ago

JohnYoung404 commented 4 years ago
League::BaseValueStorage * League::BaseValueStorage::Create(League::Bin& a_Bin, Type a_Type, uint32_t a_Hash, BaseValueStorage* a_Parent)
{
    unsigned int t_Type = a_Type >= 128 ? a_Type - 110 : a_Type;
    switch ((Type)t_Type)
    {
    case Bool: return LM_NEW(NumberValueStorage<bool>(a_Bin, a_Parent, a_Type, a_Hash));
    case S8: return LM_NEW(NumberValueStorage<int8_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case U8: return LM_NEW(NumberValueStorage<uint8_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case S16: return LM_NEW(NumberValueStorage<int16_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case U16: return LM_NEW(NumberValueStorage<uint16_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case Link: return LM_NEW(NumberValueStorage<uint32_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case S32: return LM_NEW(NumberValueStorage<int32_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case U32: return LM_NEW(NumberValueStorage<uint32_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case S64: return LM_NEW(NumberValueStorage<int64_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case U64: return LM_NEW(NumberValueStorage<uint64_t>(a_Bin, a_Parent, a_Type, a_Hash));
    case Float: return LM_NEW(NumberValueStorage<float>(a_Bin, a_Parent, a_Type, a_Hash));
    case Hash: return LM_NEW(HashValueStorage(a_Bin, a_Parent, a_Type, a_Hash));
    case Padding: return LM_NEW(NumberValueStorage<uint8_t>(a_Bin, a_Parent, a_Type, a_Hash));

    case String: return LM_NEW(StringValueStorage(a_Bin, a_Parent, a_Type, a_Hash));

    case RGBA: return LM_NEW(RGBAStorage(a_Bin, a_Parent, a_Type, a_Hash));
    case FVec2: return LM_NEW(FVec2Storage(a_Bin, a_Parent, a_Type, a_Hash));
    case FVec3: return LM_NEW(FVec3Storage(a_Bin, a_Parent, a_Type, a_Hash));
    case FVec4: return LM_NEW(FVec4Storage(a_Bin, a_Parent, a_Type, a_Hash));
    case U16Vec3: return LM_NEW(U16Vec3Storage(a_Bin, a_Parent, a_Type, a_Hash));

    case Struct:
    case Embedded:
        return LM_NEW(StructValueStorage(a_Bin, a_Parent, a_Type, a_Hash));

    case Mat4: return LM_NEW(MatrixValueStorage(a_Bin, a_Parent, a_Type, a_Hash));
    case Container: return LM_NEW(ContainerValueStorage(a_Bin, a_Parent, a_Type, a_Hash));
    case Array: return LM_NEW(ArrayValueStorage(a_Bin, a_Parent, a_Type, a_Hash));
    case Map: return LM_NEW(MapValueStorage(a_Bin, a_Parent, a_Type, a_Hash));

--->    default: throw 0;         //An exception occurs here.
    };
}
Querijn commented 4 years ago

Hey there! Yeah, it seems Riot updated their file formats. I'll have a look.

Querijn commented 4 years ago

I've updated it. Does this fix your issue?

JohnYoung404 commented 4 years ago

Thanks for your help! After fixing the typo below, it works perfectly well!

League::BaseValueStorage * League::BaseValueStorage::Create(League::Bin& a_Bin, Type a_Type, uint32_t a_Hash, BaseValueStorage* a_Parent)
{
--->    auto t_Type = ParseBaseValueStorageType(t_Type);    //there seems to be a typo
    switch ((Type)t_Type)
    {
        .....
}
Querijn commented 4 years ago

What was the typo exactly? I'll fix it

JohnYoung404 commented 4 years ago

It seems t_Type to be a_Type

Querijn commented 4 years ago

Fixed. Thanks for letting me know! 😄