diff options
author | glighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-30 16:00:24 +0000 |
---|---|---|
committer | glighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-30 16:00:24 +0000 |
commit | e81fad940ac591a6a76ecd0aa0b1d26cff688705 (patch) | |
tree | 03e7cad0b1bd243837b40cd5045957806291b992 /src/map/homunculus.c | |
parent | a31cce3c60cc170db0d4a8ff707626e8777b0801 (diff) | |
download | hercules-e81fad940ac591a6a76ecd0aa0b1d26cff688705.tar.gz hercules-e81fad940ac591a6a76ecd0aa0b1d26cff688705.tar.bz2 hercules-e81fad940ac591a6a76ecd0aa0b1d26cff688705.tar.xz hercules-e81fad940ac591a6a76ecd0aa0b1d26cff688705.zip |
-Harmonize skillid, skill_num, skillnum, skill, to skill_id and same for skill_lv
-Optimise type from int to int16 in order to reduce ram consumtion.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17065 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/homunculus.c')
-rw-r--r-- | src/map/homunculus.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 8f54481ff..081287d8a 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -250,7 +250,7 @@ int merc_hom_calc_skilltree(struct homun_data *hd, int flag_evolve) return 0; } -int merc_hom_checkskill(struct homun_data *hd,int skill_id) +int merc_hom_checkskill(struct homun_data *hd,uint16 skill_id) { int i = skill_id - HM_SKILLBASE; if(!hd) @@ -263,15 +263,15 @@ int merc_hom_checkskill(struct homun_data *hd,int skill_id) } int merc_skill_tree_get_max(int id, int b_class){ - int i, skillid; + int i, skill_id; b_class -= HM_CLASS_BASE; - for(i=0;(skillid=hskill_tree[b_class][i].id)>0;i++) - if (id == skillid) + for(i=0;(skill_id=hskill_tree[b_class][i].id)>0;i++) + if (id == skill_id) return hskill_tree[b_class][i].max; return skill_get_max(id); } -void merc_hom_skillup(struct homun_data *hd,int skillnum) +void merc_hom_skillup(struct homun_data *hd,uint16 skill_id) { int i = 0 ; nullpo_retv(hd); @@ -279,18 +279,18 @@ void merc_hom_skillup(struct homun_data *hd,int skillnum) if(hd->homunculus.vaporize) return; - i = skillnum - HM_SKILLBASE; + i = skill_id - HM_SKILLBASE; if(hd->homunculus.skillpts > 0 && hd->homunculus.hskill[i].id && hd->homunculus.hskill[i].flag == SKILL_FLAG_PERMANENT && //Don't allow raising while you have granted skills. [Skotlex] - hd->homunculus.hskill[i].lv < merc_skill_tree_get_max(skillnum, hd->homunculus.class_) + hd->homunculus.hskill[i].lv < merc_skill_tree_get_max(skill_id, hd->homunculus.class_) ) { hd->homunculus.hskill[i].lv++; hd->homunculus.skillpts-- ; status_calc_homunculus(hd,0); if (hd->master) { - clif_homskillup(hd->master, skillnum); + clif_homskillup(hd->master, skill_id); clif_hominfo(hd->master,hd,0); clif_homskillinfoblock(hd->master); } |