mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
More style stuff;
This commit is contained in:
parent
b7f2ed462e
commit
52468262f3
5 changed files with 20 additions and 20 deletions
|
@ -35,7 +35,7 @@ uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency )
|
|||
auto classInfo = g_framework.getExdDataGen().get< Core::Data::ClassJob >( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||
auto paramGrowthInfo = g_framework.getExdDataGen().get< Core::Data::ParamGrow >( pPlayer->getLevel() );
|
||||
|
||||
if ( !classInfo || !paramGrowthInfo )
|
||||
if( !classInfo || !paramGrowthInfo )
|
||||
return 0;
|
||||
|
||||
//auto jobModVal = classInfoIt->second;
|
||||
|
|
|
@ -39,7 +39,7 @@ float CalcStats::calculateBaseStat( PlayerPtr pPlayer )
|
|||
uint8_t level = pPlayer->getLevel();
|
||||
|
||||
// SB Base Stat Formula (Aligned)
|
||||
if ( level > 60 )
|
||||
if( level > 60 )
|
||||
{
|
||||
base = static_cast< float >( ( ( ( level == 61 ) ? 224 : 220 ) + ( level - 61 ) * 8) );
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ uint32_t CalcStats::calculateMaxHp( PlayerPtr pPlayer )
|
|||
auto classInfo = g_framework.getExdDataGen().get< Core::Data::ClassJob >( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||
auto paramGrowthInfo = g_framework.getExdDataGen().get< Core::Data::ParamGrow >( pPlayer->getLevel() );
|
||||
|
||||
if ( !classInfo || !paramGrowthInfo )
|
||||
if( !classInfo || !paramGrowthInfo )
|
||||
return 0;
|
||||
|
||||
uint8_t level = pPlayer->getLevel();
|
||||
|
@ -98,7 +98,7 @@ uint32_t CalcStats::calculateMaxMp( PlayerPtr pPlayer )
|
|||
auto classInfo = g_framework.getExdDataGen().get< Core::Data::ClassJob >( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||
auto paramGrowthInfo = g_framework.getExdDataGen().get< Core::Data::ParamGrow >( pPlayer->getLevel() );
|
||||
|
||||
if ( !classInfo || !paramGrowthInfo )
|
||||
if( !classInfo || !paramGrowthInfo )
|
||||
return 0;
|
||||
|
||||
float baseStat = calculateBaseStat( pPlayer );
|
||||
|
|
|
@ -209,7 +209,7 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
|
|||
auto fromAetheryte = g_framework.getExdDataGen().get< Core::Data::Aetheryte >( g_framework.getExdDataGen().get< Core::Data::TerritoryType >( player.getZoneId() )->aetheryte );
|
||||
|
||||
// calculate cost - does not apply for favorite points or homepoints neither checks for aether tickets
|
||||
auto cost = static_cast< uint16_t > ( ( sqrt( pow( fromAetheryte->aetherstreamX - targetAetheryte->aetherstreamX, 2 ) +
|
||||
auto cost = static_cast< uint16_t >( ( sqrt( pow( fromAetheryte->aetherstreamX - targetAetheryte->aetherstreamX, 2 ) +
|
||||
pow( fromAetheryte->aetherstreamY - targetAetheryte->aetherstreamY, 2 ) ) / 2 ) + 100 );
|
||||
|
||||
// cap at 999 gil
|
||||
|
|
|
@ -56,7 +56,7 @@ void Core::Network::GameConnection::eventHandlerTalk( const Packets::GamePacket&
|
|||
eventType == Event::EventHandler::EventHandlerType::Quest )
|
||||
{
|
||||
auto questInfo = g_framework.getExdDataGen().get< Core::Data::Quest >( eventId );
|
||||
if ( questInfo )
|
||||
if( questInfo )
|
||||
player.sendUrgent( "Quest not implemented: " + questInfo->name + " (" + questInfo->id + ")" );
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ bool Core::Scripting::ScriptLoader::unloadModule( ModuleHandle handle )
|
|||
bool success = dlclose( handle ) == 0;
|
||||
#endif
|
||||
|
||||
if ( !success )
|
||||
if( !success )
|
||||
{
|
||||
g_framework.getLogger().error( "Failed to unload module @ 0x" + boost::str( boost::format( "%|08X|" ) % handle ) );
|
||||
|
||||
|
@ -50,7 +50,7 @@ Core::Scripting::ScriptInfo* Core::Scripting::ScriptLoader::loadModule( const st
|
|||
{
|
||||
fs::path f( path );
|
||||
|
||||
if ( isModuleLoaded( f.stem().string() ) )
|
||||
if( isModuleLoaded( f.stem().string() ) )
|
||||
{
|
||||
g_framework.getLogger().error( "Unable to load module '" + f.stem().string() + "' as it is already loaded" );
|
||||
return nullptr;
|
||||
|
@ -65,7 +65,7 @@ Core::Scripting::ScriptInfo* Core::Scripting::ScriptLoader::loadModule( const st
|
|||
{
|
||||
fs::copy_file( f, dest, fs::copy_option::overwrite_if_exists );
|
||||
}
|
||||
catch ( const boost::filesystem::filesystem_error& err )
|
||||
catch( const boost::filesystem::filesystem_error& err )
|
||||
{
|
||||
g_framework.getLogger().error( "Error copying file to cache: " + err.code().message() );
|
||||
|
||||
|
@ -79,7 +79,7 @@ Core::Scripting::ScriptInfo* Core::Scripting::ScriptLoader::loadModule( const st
|
|||
ModuleHandle handle = dlopen( dest.string().c_str(), RTLD_LAZY );
|
||||
#endif
|
||||
|
||||
if ( !handle )
|
||||
if( !handle )
|
||||
{
|
||||
g_framework.getLogger().error( "Failed to load module from: " + path );
|
||||
|
||||
|
@ -109,7 +109,7 @@ ScriptObject** Core::Scripting::ScriptLoader::getScripts( ModuleHandle handle )
|
|||
getScripts func = reinterpret_cast< getScripts >( dlsym( handle, "getScripts" ) );
|
||||
#endif
|
||||
|
||||
if ( func )
|
||||
if( func )
|
||||
{
|
||||
auto ptr = func();
|
||||
|
||||
|
@ -128,13 +128,13 @@ bool Core::Scripting::ScriptLoader::unloadScript( Core::Scripting::ScriptInfo* i
|
|||
|
||||
bool Core::Scripting::ScriptLoader::unloadScript( ModuleHandle handle )
|
||||
{
|
||||
for ( auto it = m_scriptMap.begin(); it != m_scriptMap.end(); ++it )
|
||||
for( auto it = m_scriptMap.begin(); it != m_scriptMap.end(); ++it )
|
||||
{
|
||||
if ( it->second->handle == handle )
|
||||
if( it->second->handle == handle )
|
||||
{
|
||||
auto info = it->second;
|
||||
|
||||
if ( unloadModule( handle ) )
|
||||
if( unloadModule( handle ) )
|
||||
{
|
||||
m_scriptMap.erase( it );
|
||||
|
||||
|
@ -157,9 +157,9 @@ bool Core::Scripting::ScriptLoader::unloadScript( ModuleHandle handle )
|
|||
|
||||
bool Core::Scripting::ScriptLoader::isModuleLoaded( std::string name )
|
||||
{
|
||||
for ( auto it = m_scriptMap.begin(); it != m_scriptMap.end(); ++it )
|
||||
for( auto it = m_scriptMap.begin(); it != m_scriptMap.end(); ++it )
|
||||
{
|
||||
if ( boost::iequals( it->second->library_name, name ) )
|
||||
if( boost::iequals( it->second->library_name, name ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -168,9 +168,9 @@ bool Core::Scripting::ScriptLoader::isModuleLoaded( std::string name )
|
|||
|
||||
Core::Scripting::ScriptInfo* Core::Scripting::ScriptLoader::getScriptInfo( std::string name )
|
||||
{
|
||||
for ( auto it = m_scriptMap.begin(); it != m_scriptMap.end(); ++it )
|
||||
for( auto it = m_scriptMap.begin(); it != m_scriptMap.end(); ++it )
|
||||
{
|
||||
if ( it->second->library_name == name )
|
||||
if( it->second->library_name == name )
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
|
@ -181,9 +181,9 @@ Core::Scripting::ScriptInfo* Core::Scripting::ScriptLoader::getScriptInfo( std::
|
|||
|
||||
void Core::Scripting::ScriptLoader::findScripts( std::set< Core::Scripting::ScriptInfo* >& scripts, const std::string& search )
|
||||
{
|
||||
for ( auto it = m_scriptMap.begin(); it != m_scriptMap.end(); ++it )
|
||||
for( auto it = m_scriptMap.begin(); it != m_scriptMap.end(); ++it )
|
||||
{
|
||||
if ( it->second->library_name.find( search ) != std::string::npos )
|
||||
if( it->second->library_name.find( search ) != std::string::npos )
|
||||
{
|
||||
scripts.insert( it->second );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue