summaryrefslogtreecommitdiff
path: root/src/map/pc.c
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/map/pc.c
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/map/pc.c')
-rw-r--r--src/map/pc.c10
1 files changed, 8 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;