From 08893675a16df23d60c3ff907f876a434dce32d1 Mon Sep 17 00:00:00 2001 From: aleos89 Date: Sat, 28 May 2016 09:33:10 -0400 Subject: [PATCH] Fixed atcommand skilltree (fixes #1320) * Resolves the command not searching the skill_tree array using the correct class index. --- src/map/atcommand.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0df7e76e9b..cbb9f69c5b 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5664,7 +5664,7 @@ ACMD_FUNC(skilltree) { struct map_session_data *pl_sd = NULL; uint16 skill_id; - int meets, j, c=0; + int meets, i, j, c=0; char target[NAME_LENGTH]; struct skill_tree_entry *ent; nullpo_retr(-1, sd); @@ -5680,12 +5680,14 @@ ACMD_FUNC(skilltree) return -1; } - c = pc_calc_skilltree_normalize_job(pl_sd); - c = pc_mapid2jobid(c, pl_sd->status.sex); + i = pc_calc_skilltree_normalize_job(pl_sd); + c = pc_mapid2jobid(i, pl_sd->status.sex); sprintf(atcmd_output, msg_txt(sd,1168), job_name(c), pc_checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points). clif_displaymessage(fd, atcmd_output); + c = pc_class2idx(c); + ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skill_id ); if( j == MAX_SKILL_TREE || skill_tree[c][j].id == 0 ) {