1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-05 10:17:46 +00:00
sapphire/src/world/Action/ActionLut.cpp

27 lines
711 B
C++
Raw Normal View History

2019-06-02 02:30:54 +10:00
#include <cassert>
2019-05-30 15:35:05 +10:00
#include "ActionLut.h"
using namespace Sapphire::World::Action;
bool ActionLut::validEntryExists( uint16_t actionId )
2019-05-30 15:35:05 +10:00
{
auto it = m_actionLut.find( actionId );
2019-05-30 15:35:05 +10:00
if( it == m_actionLut.end() )
return false;
const auto& entry = it->second;
// if all of the fields are 0, it's not 'valid' due to parse error or no useful data in the tooltip
return entry.potency != 0 || entry.comboPotency != 0 || entry.flankPotency != 0 || entry.frontPotency != 0 ||
entry.rearPotency != 0 || entry.curePotency != 0;
2019-06-02 02:30:54 +10:00
}
const ActionEntry& ActionLut::getEntry( uint16_t actionId )
{
auto it = m_actionLut.find( actionId );
assert( it != m_actionLut.end() );
return it->second;
}