mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 19:17:45 +00:00
Merge remote-tracking branch 'remotes/origin/develop' into develop_5.2
This commit is contained in:
commit
7d561ffcbe
1 changed files with 28 additions and 2 deletions
|
@ -606,8 +606,13 @@ void Sapphire::Entity::Player::discover( int16_t map_id, int16_t sub_id )
|
|||
|
||||
int32_t offset = 4;
|
||||
|
||||
auto info = exdData.get< Sapphire::Data::Map >(
|
||||
exdData.get< Sapphire::Data::TerritoryType >( getCurrentTerritory()->getTerritoryTypeId() )->map );
|
||||
auto info = exdData.get< Sapphire::Data::Map >( map_id );
|
||||
if ( !info )
|
||||
{
|
||||
sendDebug( "discover(): Could not obtain map data for map_id == {0}", map_id );
|
||||
return;
|
||||
}
|
||||
|
||||
if( info->discoveryArrayByte )
|
||||
offset = 5 + 2 * info->discoveryIndex;
|
||||
else
|
||||
|
@ -626,7 +631,28 @@ void Sapphire::Entity::Player::discover( int16_t map_id, int16_t sub_id )
|
|||
|
||||
gainExp( exp );
|
||||
|
||||
// gain 10x additional EXP if entire map is completed
|
||||
uint32_t mask = info->discoveryFlag;
|
||||
uint32_t discoveredAreas;
|
||||
if( info->discoveryArrayByte )
|
||||
{
|
||||
discoveredAreas = ( m_discovery[ offset + 1 ] << 8 ) |
|
||||
m_discovery[ offset ];
|
||||
}
|
||||
else
|
||||
{
|
||||
discoveredAreas = ( m_discovery[ offset + 3 ] << 24 ) |
|
||||
( m_discovery[ offset + 2 ] << 16 ) |
|
||||
( m_discovery[ offset + 1 ] << 8 ) |
|
||||
m_discovery[ offset ];
|
||||
}
|
||||
|
||||
bool allDiscovered = ( ( discoveredAreas & mask ) == mask );
|
||||
|
||||
if( allDiscovered )
|
||||
{
|
||||
gainExp( exp * 10 );
|
||||
}
|
||||
}
|
||||
|
||||
bool Sapphire::Entity::Player::isNewAdventurer() const
|
||||
|
|
Loading…
Add table
Reference in a new issue