diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-12 00:01:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-12 00:09:37 +0300 |
commit | fff2194e0a6196684398d6f6efdbe426e702d067 (patch) | |
tree | e2b6b44f84daf8758d678da9a6eca19c909862ef /src | |
parent | 03c4d16662fb624a4e81dd1b18ee4bd84be8282e (diff) | |
download | hercules-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')
-rw-r--r-- | src/map/clif.c | 18 |
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; |