Browse Source

Fixed atcommand skilltree (fixes #1320)
* Resolves the command not searching the skill_tree array using the correct class index.

aleos89 9 năm trước cách đây
mục cha
commit
08893675a1
1 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 5 3
      src/map/atcommand.c

+ 5 - 3
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 )
 	{