From fefc60d0a202e489ebc0d999f13a0abcc638518a Mon Sep 17 00:00:00 2001 From: ultramage Date: Wed, 14 Nov 2007 09:31:47 +0000 Subject: Fixed some homunculus skill offset calculation mistakes (bugreport:363) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11731 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 2 +- src/map/clif.c | 6 +++--- src/map/mercenary.c | 8 ++++---- src/map/pc.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index ed16dcdf1..325177565 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5666,7 +5666,7 @@ int atcommand_useskill(const int fd, struct map_session_data* sd, const char* co return -1; } - if (skillnum >= HM_SKILLBASE && skillnum <= HM_SKILLBASE+MAX_HOMUNSKILL + if (skillnum >= HM_SKILLBASE && skillnum < HM_SKILLBASE+MAX_HOMUNSKILL && sd->hd && merc_is_hom_active(sd->hd)) // (If used with @useskill, put the homunc as dest) bl = &sd->hd->bl; else diff --git a/src/map/clif.c b/src/map/clif.c index 0c5ff0362..a332d38c9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1426,7 +1426,7 @@ int clif_homskillinfoblock(struct map_session_data *sd) WFIFOW(fd,0)=0x235; for ( i = 0; i < MAX_HOMUNSKILL; i++){ if( (id = hd->homunculus.hskill[i].id) != 0 ){ - j = id - HM_SKILLBASE - 1 ; + j = id - HM_SKILLBASE ; WFIFOW(fd,len ) = id ; WFIFOW(fd,len+2) = skill_get_inf(id) ; WFIFOW(fd,len+4) = 0 ; @@ -1450,7 +1450,7 @@ void clif_homskillup(struct map_session_data *sd, int skill_num) int fd=sd->fd, skillid; WFIFOHEAD(fd, packet_len(0x239)); nullpo_retv(sd); - skillid = skill_num - HM_SKILLBASE - 1; + skillid = skill_num - HM_SKILLBASE; hd=sd->hd; @@ -9275,7 +9275,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) if (tmp&INF_GROUND_SKILL || !tmp) return; //Using a ground/passive skill on a target? WRONG. - if (skillnum >= HM_SKILLBASE && skillnum <= HM_SKILLBASE+MAX_HOMUNSKILL) { + if (skillnum >= HM_SKILLBASE && skillnum < HM_SKILLBASE+MAX_HOMUNSKILL) { clif_parse_UseSkillToId_homun(sd->hd, sd, tick, skillnum, skilllv, target_id); return; } diff --git a/src/map/mercenary.c b/src/map/mercenary.c index ad30afa2c..f0cca5182 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -143,7 +143,7 @@ int merc_hom_calc_skilltree(struct homun_data *hd) for(i=0;i < MAX_SKILL_TREE && (id = hskill_tree[c][i].id) > 0;i++) { - if(hd->homunculus.hskill[id-HM_SKILLBASE-1].id) + if(hd->homunculus.hskill[id-HM_SKILLBASE].id) continue; //Skill already known. if(!battle_config.skillfree) { @@ -158,14 +158,14 @@ int merc_hom_calc_skilltree(struct homun_data *hd) } } if (f) - hd->homunculus.hskill[id-HM_SKILLBASE-1].id = id ; + hd->homunculus.hskill[id-HM_SKILLBASE].id = id ; } return 0; } int merc_hom_checkskill(struct homun_data *hd,int skill_id) { - int i = skill_id - HM_SKILLBASE - 1; + int i = skill_id - HM_SKILLBASE; if(!hd) return 0; @@ -192,7 +192,7 @@ void merc_hom_skillup(struct homun_data *hd,int skillnum) if(hd->homunculus.vaporize) return; - i = skillnum - HM_SKILLBASE - 1; + i = skillnum - HM_SKILLBASE; if(hd->homunculus.skillpts > 0 && hd->homunculus.hskill[i].id && hd->homunculus.hskill[i].flag == 0 && //Don't allow raising while you have granted skills. [Skotlex] diff --git a/src/map/pc.c b/src/map/pc.c index 5ce0cae1f..5c46708b1 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4544,12 +4544,12 @@ int pc_skillup(struct map_session_data *sd,int skill_num) { nullpo_retr(0, sd); - if(skill_num >= GD_SKILLBASE){ + if(skill_num >= GD_SKILLBASE && skill_num < GD_SKILLBASE+MAX_GUILDSKILL){ guild_skillup(sd, skill_num); return 0; } - if(skill_num >= HM_SKILLBASE && sd->hd){ + if(skill_num >= HM_SKILLBASE && skill_num < HM_SKILLBASE+MAX_HOMUNSKILL && sd->hd){ merc_hom_skillup(sd->hd, skill_num); return 0; } -- cgit v1.2.3-60-g2f50