summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2015-02-17 03:37:30 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2015-02-17 03:37:30 +0800
commite809003ebc015acc98728ba6f4515da173d8aabd (patch)
treea8cc765dce6339e0a6331c1aebb536539bb9c282 /src/map/pc.c
parent2c70d609d016e727c9ada8e65baa61e6456844da (diff)
downloadhercules-e809003ebc015acc98728ba6f4515da173d8aabd.tar.gz
hercules-e809003ebc015acc98728ba6f4515da173d8aabd.tar.bz2
hercules-e809003ebc015acc98728ba6f4515da173d8aabd.tar.xz
hercules-e809003ebc015acc98728ba6f4515da173d8aabd.zip
Fixed Bug#7938
-http://hercules.ws/board/tracker/issue-7938-frenzy/?gopid=21566#entry21566 Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index f41665fad..6b6c27e0a 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1502,8 +1502,15 @@ int pc_calc_skilltree(struct map_session_data *sd)
}
}
}
- if( sd->status.job_level < pc->skill_tree[c][i].joblv )
- f = 0; // job level requirement wasn't satisfied
+ if ( sd->status.job_level < pc->skill_tree[c][i].joblv ) {
+ int x = pc->mapid2jobid(sd->class_, sd->status.sex); // need to get its own skilltree
+ if ( x > -1 ) {
+ x = pc->class2idx(x);
+ if ( !pc->skill_tree[x][i].inherited )
+ f = 0; // job level requirement wasn't satisfied
+ } else
+ f = 0;
+ }
}
if( f ) {
int inf2;
@@ -1597,8 +1604,16 @@ void pc_check_skilltree(struct map_session_data *sd, int skill_id)
}
if( !f )
continue;
- if( sd->status.job_level < pc->skill_tree[c][i].joblv )
- continue;
+
+ if ( sd->status.job_level < pc->skill_tree[c][i].joblv ) {
+ int x = pc->mapid2jobid(sd->class_, sd->status.sex); // need to get its own skilltree
+ if ( x > -1 ) {
+ x = pc->class2idx(x);
+ if ( !pc->skill_tree[x][i].inherited )
+ continue;
+ } else
+ continue;
+ }
j = skill->db[idx].inf2;
if( !sd->status.skill[idx].lv && (
@@ -10255,8 +10270,8 @@ void pc_read_skill_tree(void) {
break;
} else if ( pc->skill_tree[idx][a].id || ( pc->skill_tree[idx][a].id == NV_TRICKDEAD && ((pc->jobid2mapid(jnames[k].id)&(MAPID_BASEMASK|JOBL_2))!=MAPID_NOVICE) ) ) /* we skip trickdead for non-novices */
continue;/* skip */
-
- memcpy(&pc->skill_tree[idx][a],&pc->skill_tree[fidx][f],sizeof(pc->skill_tree[fidx][f]));
+ memcpy(&pc->skill_tree[idx][a], &pc->skill_tree[fidx][f], sizeof(pc->skill_tree[fidx][f]));
+ pc->skill_tree[idx][a].inherited = 1;
}
}