1
This commit is contained in:
parent
846cb77eec
commit
2ed275a383
@ -1,5 +1,7 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include <a8/magicenum.h>
|
||||
|
||||
#include "skillhelper.h"
|
||||
#include "creature.h"
|
||||
#include "buff.h"
|
||||
@ -18,18 +20,19 @@
|
||||
std::map<int, int> SkillHelper::magic_skill_hash_;
|
||||
std::map<int, int> SkillHelper::skill_magic_hash_;
|
||||
|
||||
static int GetMagicSkillId(int magic_id)
|
||||
{
|
||||
}
|
||||
|
||||
void SkillHelper::Init()
|
||||
{
|
||||
for (int i = MAGIC_NONE; i < MAGIC_END; ++i) {
|
||||
if (i != 0) {
|
||||
int skill_id = GetMagicSkillId(i);
|
||||
auto fields = a8::GetEnumFields<MagicType_e>();
|
||||
for (auto& tuple : *fields){
|
||||
std::string name = std::get<0>(tuple);
|
||||
int val = std::get<1>(tuple);
|
||||
if (val > MAGIC_NONE && val < MAGIC_END) {
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(name, strings, '_');
|
||||
int skill_id = a8::XValue(strings[1]);
|
||||
if (skill_id) {
|
||||
magic_skill_hash_[i] = skill_id;
|
||||
skill_magic_hash_[skill_id] = i;
|
||||
magic_skill_hash_[val] = skill_id;
|
||||
skill_magic_hash_[skill_id] = val;
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user