mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 06:27:45 +00:00
Merge pull request #930 from T00fy/master
Some bug fixes and very minor refactoring
This commit is contained in:
commit
e7cfe87fef
3 changed files with 11 additions and 5 deletions
|
@ -642,11 +642,6 @@ void Player::levelUp()
|
||||||
m_mp = getMaxMp();
|
m_mp = getMaxMp();
|
||||||
|
|
||||||
setLevel( getLevel() + 1 );
|
setLevel( getLevel() + 1 );
|
||||||
Network::Util::Packet::sendActorControl( getInRangePlayerIds( true ), getId(), LevelUpEffect, static_cast< uint8_t >( getClass() ), getLevel(), getLevel() - 1 );
|
|
||||||
|
|
||||||
auto& achvMgr = Common::Service< World::Manager::AchievementMgr >::ref();
|
|
||||||
achvMgr.progressAchievementByType< Common::Achievement::Type::Classjob >( *this, static_cast< uint32_t >( getClass() ) );
|
|
||||||
Service< World::Manager::MapMgr >::ref().updateQuests( *this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Player::getLevel() const
|
uint8_t Player::getLevel() const
|
||||||
|
@ -733,6 +728,11 @@ void Player::setLevel( uint8_t level )
|
||||||
Network::Util::Packet::sendBaseParams( *this );
|
Network::Util::Packet::sendBaseParams( *this );
|
||||||
Network::Util::Packet::sendHudParam( *this );
|
Network::Util::Packet::sendHudParam( *this );
|
||||||
Network::Util::Packet::sendStatusUpdate( *this );
|
Network::Util::Packet::sendStatusUpdate( *this );
|
||||||
|
Network::Util::Packet::sendActorControl( getInRangePlayerIds( true ), getId(), LevelUpEffect, static_cast< uint8_t >( getClass() ), getLevel(), getLevel() - 1 );
|
||||||
|
|
||||||
|
auto& achvMgr = Common::Service< World::Manager::AchievementMgr >::ref();
|
||||||
|
achvMgr.progressAchievementByType< Common::Achievement::Type::Classjob >( *this, static_cast< uint32_t >( getClass() ) );
|
||||||
|
Service< World::Manager::MapMgr >::ref().updateQuests( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::setLevelForClass( uint8_t level, Common::ClassJob classjob )
|
void Player::setLevelForClass( uint8_t level, Common::ClassJob classjob )
|
||||||
|
|
|
@ -836,6 +836,7 @@ Entity::BNpcPtr Territory::createBNpcFromLayoutId( uint32_t layoutId, uint32_t h
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
auto pBNpc = std::make_shared< Entity::BNpc >( getNextActorId(), infoPtr->second, *this, hp, bnpcType );
|
auto pBNpc = std::make_shared< Entity::BNpc >( getNextActorId(), infoPtr->second, *this, hp, bnpcType );
|
||||||
|
pBNpc->init();
|
||||||
pBNpc->setTriggerOwnerId( triggerOwnerId );
|
pBNpc->setTriggerOwnerId( triggerOwnerId );
|
||||||
pushActor( pBNpc );
|
pushActor( pBNpc );
|
||||||
return pBNpc;
|
return pBNpc;
|
||||||
|
|
|
@ -144,6 +144,11 @@ std::string readFileToString( const std::string& filename )
|
||||||
// Close the file
|
// Close the file
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
// Remove all newlines from the file contents
|
||||||
|
fileContents.erase( std::remove( fileContents.begin(), fileContents.end(), '\n' ), fileContents.end() );
|
||||||
|
fileContents.erase( std::remove( fileContents.begin(), fileContents.end(), '\r' ), fileContents.end() );
|
||||||
|
|
||||||
|
|
||||||
// Return the file contents as a string
|
// Return the file contents as a string
|
||||||
return fileContents;
|
return fileContents;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue