Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some bug fixes and very minor refactoring #930

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/world/Actor/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,6 @@ void Player::levelUp()
m_mp = getMaxMp();

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
Expand Down Expand Up @@ -733,6 +728,11 @@ void Player::setLevel( uint8_t level )
Network::Util::Packet::sendBaseParams( *this );
Network::Util::Packet::sendHudParam( *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 )
Expand Down
1 change: 1 addition & 0 deletions src/world/Territory/Territory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ Entity::BNpcPtr Territory::createBNpcFromLayoutId( uint32_t layoutId, uint32_t h
return nullptr;

auto pBNpc = std::make_shared< Entity::BNpc >( getNextActorId(), infoPtr->second, *this, hp, bnpcType );
pBNpc->init();
pBNpc->setTriggerOwnerId( triggerOwnerId );
pushActor( pBNpc );
return pBNpc;
Expand Down
5 changes: 5 additions & 0 deletions src/world/WorldServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ std::string readFileToString( const std::string& filename )
// Close the file
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 fileContents;
}
Expand Down