summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-27 19:57:47 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-27 20:09:47 +0300
commitccdc1209dfa3aece4800f44a23f1b3d5890c5e12 (patch)
tree5532c0e3d55878660da6f80bbcc97da57b7bc886 /src
parenta2329f4f10a3ab2e70141766a16981e69e2a71ba (diff)
downloadhercules-ccdc1209dfa3aece4800f44a23f1b3d5890c5e12.tar.gz
hercules-ccdc1209dfa3aece4800f44a23f1b3d5890c5e12.tar.bz2
hercules-ccdc1209dfa3aece4800f44a23f1b3d5890c5e12.tar.xz
hercules-ccdc1209dfa3aece4800f44a23f1b3d5890c5e12.zip
In clif_devotion dont read skill range if player not have this skill.
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c14
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 )