Skip to content

Commit

Permalink
Fixed atcommand skilltree (fixes #1320)
Browse files Browse the repository at this point in the history
* Resolves the command not searching the skill_tree array using the correct class index.
  • Loading branch information
aleos89 committed May 28, 2016
1 parent f0ed0cf commit 0889367
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/map/atcommand.c
Expand Up @@ -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);
Expand All @@ -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 )
{
Expand Down

0 comments on commit 0889367

Please sign in to comment.