summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-12 00:01:32 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-12 00:09:37 +0300
commitfff2194e0a6196684398d6f6efdbe426e702d067 (patch)
treee2b6b44f84daf8758d678da9a6eca19c909862ef /src/map/clif.c
parent03c4d16662fb624a4e81dd1b18ee4bd84be8282e (diff)
downloadhercules-fff2194e0a6196684398d6f6efdbe426e702d067.tar.gz
hercules-fff2194e0a6196684398d6f6efdbe426e702d067.tar.bz2
hercules-fff2194e0a6196684398d6f6efdbe426e702d067.tar.xz
hercules-fff2194e0a6196684398d6f6efdbe426e702d067.zip
Fix issue http://hercules.ws/board/tracker/issue-8672-map-server-error/
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index d28e64cd3..efad7b5e1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4579,15 +4579,23 @@ void clif_skillinfoblock(struct map_session_data *sd)
WFIFOW(fd,0) = 0x10f;
for ( i = 0, len = 4; i < MAX_SKILL; i++) {
if( (id = sd->status.skill[i].id) != 0 ) {
+ int level;
// workaround for bugreport:5348
if (len + 37 > 8192)
break;
- WFIFOW(fd,len) = id;
- WFIFOL(fd,len+2) = skill->get_inf(id);
- WFIFOW(fd,len+6) = sd->status.skill[i].lv;
- WFIFOW(fd,len+8) = skill->get_sp(id,sd->status.skill[i].lv);
- WFIFOW(fd,len+10)= skill->get_range2(&sd->bl, id,sd->status.skill[i].lv);
+ WFIFOW(fd, len) = id;
+ WFIFOL(fd, len + 2) = skill->get_inf(id);
+ level = sd->status.skill[i].lv;
+ WFIFOW(fd, len + 6) = level;
+ if (level) {
+ WFIFOW(fd, len + 8) = skill->get_sp(id, level);
+ WFIFOW(fd, len + 10)= skill->get_range2(&sd->bl, id, level);
+ }
+ else {
+ WFIFOW(fd, len + 8) = 0;
+ WFIFOW(fd, len + 10)= 0;
+ }
safestrncpy((char*)WFIFOP(fd,len+12), skill->get_name(id), NAME_LENGTH);
if(sd->status.skill[i].flag == SKILL_FLAG_PERMANENT)
WFIFOB(fd,len+36) = (sd->status.skill[i].lv < skill->tree_get_max(id, sd->status.class_))? 1:0;