1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-06-08 08:57:45 +00:00
This commit is contained in:
Alice Ogeda 2023-03-24 14:11:07 -03:00
parent 09d0469c96
commit f6ce8207b2

View file

@ -227,6 +227,8 @@ struct LGB_GROUP
memcpy( (char*)&refs[0], buf + offset + header.LayerSetRef + layerSetReferencedList.LayerSets, layerSetReferencedList.LayerSetCount * sizeof( LayerSetReferenced ) ); memcpy( (char*)&refs[0], buf + offset + header.LayerSetRef + layerSetReferencedList.LayerSets, layerSetReferencedList.LayerSetCount * sizeof( LayerSetReferenced ) );
} }
entries.reserve( header.entryCount );
const auto entriesOffset = offset + header.entriesOffset; const auto entriesOffset = offset + header.entriesOffset;
for( auto i = 0; i < header.entryCount; ++i ) for( auto i = 0; i < header.entryCount; ++i )
{ {
@ -235,41 +237,53 @@ struct LGB_GROUP
try try
{ {
const auto type = *reinterpret_cast< LgbEntryType* >( buf + entryOffset ); const auto type = *reinterpret_cast< LgbEntryType* >( buf + entryOffset );
if( type == LgbEntryType::BgParts ) switch( type )
{
case LgbEntryType::BgParts:
{ {
entries.emplace_back( std::make_shared< LGB_BGPARTS_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_BGPARTS_ENTRY >( buf, entryOffset ) );
break;
} }
else if( type == LgbEntryType::Gimmick ) case LgbEntryType::Gimmick:
{ {
entries.emplace_back( std::make_shared< LGB_GIMMICK_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_GIMMICK_ENTRY >( buf, entryOffset ) );
break;
} }
else if( type == LgbEntryType::EventNpc ) case LgbEntryType::EventNpc:
{ {
entries.emplace_back( std::make_shared< LGB_ENPC_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_ENPC_ENTRY >( buf, entryOffset ) );
break;
} }
else if( type == LgbEntryType::EventObject ) case LgbEntryType::EventObject:
{ {
entries.emplace_back( std::make_shared< LGB_EOBJ_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_EOBJ_ENTRY >( buf, entryOffset ) );
break;
} }
else if( type == LgbEntryType::ExitRange ) case LgbEntryType::ExitRange:
{ {
entries.emplace_back( std::make_shared< LGB_EXIT_RANGE_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_EXIT_RANGE_ENTRY >( buf, entryOffset ) );
break;
} }
else if( type == LgbEntryType::EventRange ) case LgbEntryType::EventRange:
{ {
entries.emplace_back( std::make_shared< LGB_EVENT_RANGE_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_EVENT_RANGE_ENTRY >( buf, entryOffset ) );
break;
} }
else if( type == LgbEntryType::PopRange ) case LgbEntryType::PopRange:
{ {
entries.emplace_back( std::make_shared< LGB_POP_RANGE_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_POP_RANGE_ENTRY >( buf, entryOffset ) );
break;
} }
else if( type == LgbEntryType::MapRange ) case LgbEntryType::MapRange:
{ {
entries.emplace_back( std::make_shared< LGB_MAP_RANGE_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_MAP_RANGE_ENTRY >( buf, entryOffset ) );
break;
} }
else default:
{ {
entries.emplace_back( std::make_shared< LgbEntry >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LgbEntry >( buf, entryOffset ) );
break;
}
} }
} }
catch( std::exception& e ) catch( std::exception& e )