diff options
author | Haru <haru@dotalux.com> | 2016-09-27 20:24:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-27 20:24:58 +0200 |
commit | 84ecefb4db23bbd98194a43a592cfe313477a1ab (patch) | |
tree | 6359bb8a2ad7bf2f3357077e1708e365f041b017 /src/map/clif.c | |
parent | a2329f4f10a3ab2e70141766a16981e69e2a71ba (diff) | |
parent | bf34e9a19ec0afc5d4a9494e20015a65ba5a76c2 (diff) | |
download | hercules-84ecefb4db23bbd98194a43a592cfe313477a1ab.tar.gz hercules-84ecefb4db23bbd98194a43a592cfe313477a1ab.tar.bz2 hercules-84ecefb4db23bbd98194a43a592cfe313477a1ab.tar.xz hercules-84ecefb4db23bbd98194a43a592cfe313477a1ab.zip |
Merge pull request #1443 from 4144/smallfixes
Small fixes
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index e4ff1644b..09e8bbb6b 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7107,21 +7107,31 @@ void clif_devotion(struct block_list *src, struct map_session_data *tsd) if( src->type == BL_MER ) { struct mercenary_data *md = BL_CAST(BL_MER,src); + int skill_lvl; if( md && md->master && md->devotion_flag ) WBUFL(buf,6) = md->master->bl.id; - WBUFW(buf,26) = skill->get_range2(src, ML_DEVOTION, mercenary->checkskill(md, ML_DEVOTION)); + skill_lvl = mercenary->checkskill(md, ML_DEVOTION); + if (skill_lvl > 0) + WBUFW(buf, 26) = skill->get_range2(src, ML_DEVOTION, skill_lvl); + else + WBUFW(buf, 26) = 0; } else { int i; struct map_session_data *sd = BL_CAST(BL_PC,src); + int skill_lvl; if( sd == NULL ) return; for( i = 0; i < MAX_PC_DEVOTION; i++ ) WBUFL(buf,6+4*i) = sd->devotion[i]; - WBUFW(buf,26) = skill->get_range2(src, CR_DEVOTION, pc->checkskill(sd, CR_DEVOTION)); + skill_lvl = pc->checkskill(sd, CR_DEVOTION); + if (skill_lvl > 0) + WBUFW(buf, 26) = skill->get_range2(src, CR_DEVOTION, skill_lvl); + else + WBUFW(buf, 26) = 0; } if( tsd ) |