1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-06-08 00:47: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 )
{ {
entries.emplace_back( std::make_shared< LGB_BGPARTS_ENTRY >( buf, entryOffset ) ); case LgbEntryType::BgParts:
} {
else if( type == LgbEntryType::Gimmick ) entries.emplace_back( std::make_shared< LGB_BGPARTS_ENTRY >( buf, entryOffset ) );
{ break;
entries.emplace_back( std::make_shared< LGB_GIMMICK_ENTRY >( buf, entryOffset ) ); }
} case LgbEntryType::Gimmick:
else if( type == LgbEntryType::EventNpc ) {
{ entries.emplace_back( std::make_shared< LGB_GIMMICK_ENTRY >( buf, entryOffset ) );
entries.emplace_back( std::make_shared< LGB_ENPC_ENTRY >( buf, entryOffset ) ); break;
} }
else if( type == LgbEntryType::EventObject ) case LgbEntryType::EventNpc:
{ {
entries.emplace_back( std::make_shared< LGB_EOBJ_ENTRY >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_ENPC_ENTRY >( buf, entryOffset ) );
} break;
else if( type == LgbEntryType::ExitRange ) }
{ case LgbEntryType::EventObject:
entries.emplace_back( std::make_shared< LGB_EXIT_RANGE_ENTRY >( buf, entryOffset ) ); {
} entries.emplace_back( std::make_shared< LGB_EOBJ_ENTRY >( buf, entryOffset ) );
else if( type == LgbEntryType::EventRange ) break;
{ }
entries.emplace_back( std::make_shared< LGB_EVENT_RANGE_ENTRY >( buf, entryOffset ) ); case LgbEntryType::ExitRange:
} {
else if( type == LgbEntryType::PopRange ) entries.emplace_back( std::make_shared< LGB_EXIT_RANGE_ENTRY >( buf, entryOffset ) );
{ break;
entries.emplace_back( std::make_shared< LGB_POP_RANGE_ENTRY >( buf, entryOffset ) ); }
} case LgbEntryType::EventRange:
else if( type == LgbEntryType::MapRange ) {
{ entries.emplace_back( std::make_shared< LGB_EVENT_RANGE_ENTRY >( buf, entryOffset ) );
entries.emplace_back( std::make_shared< LGB_MAP_RANGE_ENTRY >( buf, entryOffset ) ); break;
} }
else case LgbEntryType::PopRange:
{ {
entries.emplace_back( std::make_shared< LgbEntry >( buf, entryOffset ) ); entries.emplace_back( std::make_shared< LGB_POP_RANGE_ENTRY >( buf, entryOffset ) );
break;
}
case LgbEntryType::MapRange:
{
entries.emplace_back( std::make_shared< LGB_MAP_RANGE_ENTRY >( buf, entryOffset ) );
break;
}
default:
{
entries.emplace_back( std::make_shared< LgbEntry >( buf, entryOffset ) );
break;
}
} }
} }
catch( std::exception& e ) catch( std::exception& e )