summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-18 22:25:56 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-23 07:33:45 +0300
commitd442a7c0bfd05c6c51f7bb7f29ed20926e765f68 (patch)
tree8accc94979d1fda575d8fca6a2730b1cf5702556 /src
parent1935ad18f51f0b72d95411d1ccd24a568e91cc20 (diff)
downloadhercules-d442a7c0bfd05c6c51f7bb7f29ed20926e765f68.tar.gz
hercules-d442a7c0bfd05c6c51f7bb7f29ed20926e765f68.tar.bz2
hercules-d442a7c0bfd05c6c51f7bb7f29ed20926e765f68.tar.xz
hercules-d442a7c0bfd05c6c51f7bb7f29ed20926e765f68.zip
Move job related checks from pc_read_skill_tree into separate function.
Diffstat (limited to 'src')
-rw-r--r--src/map/pc.c10
-rw-r--r--src/map/pc.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 08fbae7ea..8dd216f55 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -11135,6 +11135,11 @@ int pc_split_atoui64(char* str, uint64* val, char sep, int max)
return i;
}
+bool pc_read_skill_job_skip(short skill_id, int job_id)
+{
+ return skill_id == NV_TRICKDEAD && ((pc->jobid2mapid(job_id) & (MAPID_BASEMASK | JOBL_2)) != MAPID_NOVICE); // skip trickdead for non-novices
+}
+
/**
* Parses the skill tree config file.
*
@@ -11215,8 +11220,8 @@ void pc_read_skill_tree(void)
ShowWarning("pc_read_skill_tree: '%s' can't inherit '%s', skill tree is full!\n", job_name, ijob_name);
break;
}
- if (src->id == NV_TRICKDEAD && ((pc->jobid2mapid(job_id)&(MAPID_BASEMASK | JOBL_2)) != MAPID_NOVICE))
- continue; // skip trickdead for non-novices
+ if (pc->read_skill_job_skip(src->id, job_id))
+ continue;
dst = &pc->skill_tree[job_idx][cur];
dst->inherited = 1;
if (dst->id == 0) {
@@ -12481,6 +12486,7 @@ void pc_defaults(void) {
pc->autosave = pc_autosave;
pc->follow_timer = pc_follow_timer;
pc->read_skill_tree = pc_read_skill_tree;
+ pc->read_skill_job_skip = pc_read_skill_job_skip;
pc->clear_skill_tree = pc_clear_skill_tree;
pc->isUseitem = pc_isUseitem;
pc->show_steal = pc_show_steal;
diff --git a/src/map/pc.h b/src/map/pc.h
index 62a829734..49c102206 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -1101,6 +1101,7 @@ END_ZEROED_BLOCK; /* End */
int (*autosave) (int tid, int64 tick, int id, intptr_t data);
int (*follow_timer) (int tid, int64 tick, int id, intptr_t data);
void (*read_skill_tree) (void);
+ bool (*read_skill_job_skip) (short skill_id, int job_id);
void (*clear_skill_tree) (void);
int (*isUseitem) (struct map_session_data *sd,int n);
int (*show_steal) (struct block_list *bl,va_list ap);