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