diff --git a/src/common/Util/Util.cpp b/src/common/Util/Util.cpp index bd6622a7..498fec78 100644 --- a/src/common/Util/Util.cpp +++ b/src/common/Util/Util.cpp @@ -29,6 +29,12 @@ void Core::Util::eraseAll( std::string& inOutStr, char remove ) inOutStr.erase( std::remove( inOutStr.begin(), inOutStr.end(), remove ), inOutStr.end() ); } +void Core::Util::eraseAllIn( std::string& inOutStr, std::string& remove ) +{ + for( auto rem : remove ) + inOutStr.erase( std::remove( inOutStr.begin(), inOutStr.end(), rem ), inOutStr.end() ); +} + std::string Core::Util::intToHexString( uint64_t intValue, uint8_t width ) { diff --git a/src/common/Util/Util.h b/src/common/Util/Util.h index 79c19e05..5d1947d0 100644 --- a/src/common/Util/Util.h +++ b/src/common/Util/Util.h @@ -14,6 +14,7 @@ std::string binaryToHexDump( uint8_t* pBinData, uint16_t size ); std::string intToHexString( uint64_t intValue, uint8_t width = 2 ); void eraseAll( std::string& inOutStr, char remove ); +void eraseAllIn( std::string& inOutStr, std::string& remove ); std::string toLowerCopy( const std::string& inStr ); diff --git a/src/servers/sapphire_zone/Actor/PlayerInventory.cpp b/src/servers/sapphire_zone/Actor/PlayerInventory.cpp index e713a610..812a2f1e 100644 --- a/src/servers/sapphire_zone/Actor/PlayerInventory.cpp +++ b/src/servers/sapphire_zone/Actor/PlayerInventory.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "Zone/Zone.h" @@ -847,7 +848,7 @@ uint16_t Core::Entity::Player::calculateEquippedGearItemLevel() it++; } - return std::max( iLvlResult / 13, 9999 ); + return std::max( static_cast< int32_t >( iLvlResult / 13 ), 9999 ); } diff --git a/src/servers/sapphire_zone/Event/EventHelper.cpp b/src/servers/sapphire_zone/Event/EventHelper.cpp index 467c9c58..c87889bc 100644 --- a/src/servers/sapphire_zone/Event/EventHelper.cpp +++ b/src/servers/sapphire_zone/Event/EventHelper.cpp @@ -1,7 +1,6 @@ #include #include -#include -#include +#include #include "Framework.h" #include "EventHelper.h" @@ -62,8 +61,8 @@ std::string Core::Event::getEventName( uint32_t eventId ) { auto contentInfo = pExdData->get< Core::Data::InstanceContent >( eventId & 0xFFFF ); std::string name = contentInfo->name; - - name.erase( boost::remove_if( name, boost::is_any_of( "★_ '()[]-\x1a\x1\x2\x1f\x1\x3.:" ) ), name.end() ); + std::string remove( "★_ '()[]-\x1a\x1\x2\x1f\x1\x3.:" ); + Util::eraseAllIn( name, remove ); name[ 0 ] = toupper( name[ 0 ] ); return name; }