1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Fixed a couple compiler warnings

This commit is contained in:
root 2018-09-26 03:32:43 -04:00
parent 8f9f5893dd
commit 2228979cd1
5 changed files with 8 additions and 6 deletions

View file

@ -207,7 +207,7 @@ boost::shared_ptr< Mysql::PreparedStatement > Core::Db::DbConnection::getPrepare
assert( index < m_stmts.size() );
auto ret = m_stmts[ index ];
if( !ret )
nullptr;
return nullptr;
return ret;
}

View file

@ -118,4 +118,4 @@ uint32_t Core::Entity::BNpc::getBNpcNameId() const
void Core::Entity::BNpc::spawn( PlayerPtr pTarget )
{
pTarget->queuePacket( boost::make_shared< NpcSpawnPacket >( *getAsBNpc(), *pTarget ) );
}
}

View file

@ -31,7 +31,7 @@ public:
void spawn( PlayerPtr pTarget ) override;
uint16_t getModelChara() const;
uint8_t getLevel() const;
uint8_t getLevel() const override;
uint32_t getBNpcBaseId() const;
uint32_t getBNpcNameId() const;

View file

@ -458,7 +458,8 @@ void Core::Entity::Chara::handleScriptSkill( uint32_t type, uint16_t actionId, u
effectPacket->addEffect( effectEntry );
if( actionInfoPtr->castType == 1 && actionInfoPtr->effectRange != 0 || actionInfoPtr->castType != 1 )
if( ( actionInfoPtr->castType == 1 && actionInfoPtr->effectRange != 0 ) ||
( actionInfoPtr->castType != 1 ) )
{
// If action on this specific target is valid...
if( isPlayer() && !ActionCollision::isActorApplicable( target, TargetFilter::Enemies ) )
@ -518,7 +519,7 @@ void Core::Entity::Chara::handleScriptSkill( uint32_t type, uint16_t actionId, u
effectPacket->addEffect( effectEntry );
if( actionInfoPtr->castType == 1 && actionInfoPtr->effectRange != 0 || actionInfoPtr->castType != 1 )
if( ( actionInfoPtr->castType == 1 && actionInfoPtr->effectRange != 0 ) || actionInfoPtr->castType != 1 )
{
if( isPlayer() && !ActionCollision::isActorApplicable( target, TargetFilter::Allies ) )
break;

View file

@ -313,6 +313,7 @@ bool Core::Entity::Player::loadSearchInfo()
// todo: internally use an std::string instead of a char[]
auto searchMessage = res->getString( 4 );
memset( m_searchMessage, 0, sizeof( m_searchMessage ) );
std::copy( searchMessage.begin(), searchMessage.end(), m_searchMessage );
return true;
@ -501,7 +502,7 @@ void Core::Entity::Player::updateDbSearchInfo() const
pDb->execute( stmtS1 );
auto stmtS2 = pDb->getPreparedStatement( Db::CHARA_SEARCHINFO_UP_SEARCHCOMMENT );
stmtS2->setString( 1, string( m_searchMessage != nullptr ? m_searchMessage : "" ) );
stmtS2->setString( 1, string( m_searchMessage ) );
stmtS2->setInt( 2, m_id );
pDb->execute( stmtS2 );
}