1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 14:07:46 +00:00

slightly better name for the cost check function

This commit is contained in:
NotAdam 2019-04-04 22:00:36 +11:00
parent a0aa7ea977
commit 89f60df2c8
2 changed files with 5 additions and 5 deletions

View file

@ -267,7 +267,7 @@ void Sapphire::Action::Action::execute()
assert( m_pSource ); assert( m_pSource );
// subtract costs first, if somehow the caster stops meeting those requirements cancel the cast // subtract costs first, if somehow the caster stops meeting those requirements cancel the cast
if( !casterHasCostRequirements( true ) ) if( !costCheck( true ) )
{ {
interrupt(); interrupt();
return; return;
@ -405,7 +405,7 @@ bool Sapphire::Action::Action::playerPrecheck( Entity::Player& player )
// validate range // validate range
if( !casterHasCostRequirements() ) if( !costCheck() )
return false; return false;
return true; return true;
@ -433,7 +433,7 @@ bool Sapphire::Action::Action::isComboAction() const
return m_actionData->actionCombo == lastActionId; return m_actionData->actionCombo == lastActionId;
} }
bool Sapphire::Action::Action::casterHasCostRequirements( bool subtractCosts ) bool Sapphire::Action::Action::costCheck( bool subtractCosts )
{ {
return primaryCostCheck( subtractCosts ) && secondaryCostCheck( subtractCosts ); return primaryCostCheck( subtractCosts ) && secondaryCostCheck( subtractCosts );
} }
@ -470,7 +470,7 @@ bool Sapphire::Action::Action::primaryCostCheck( bool subtractCosts )
return true; return true;
} }
// free casts, likely just pure ogcds // free casts, likely just pure ogcds
case Common::ActionPrimaryCostType::None: case Common::ActionPrimaryCostType::None:
{ {
return true; return true;

View file

@ -52,7 +52,7 @@ namespace Sapphire::Action
* @param subtractCosts Whether we should subtract the costs (eg, mp/tp) from the player or to just check them * @param subtractCosts Whether we should subtract the costs (eg, mp/tp) from the player or to just check them
* @return whether the requirements are met by the caster * @return whether the requirements are met by the caster
*/ */
bool casterHasCostRequirements( bool subtractCosts = false ); bool costCheck( bool subtractCosts = false );
/*! /*!
* @brief Checks if the action *may* target a resident instead of an actor * @brief Checks if the action *may* target a resident instead of an actor