diff options
author | Haruna <haru@dotalux.com> | 2015-05-11 23:44:03 +0200 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2015-05-11 23:44:03 +0200 |
commit | 085c4c49df8ed8ec7d1bdf659871f63ceff7b3d3 (patch) | |
tree | e2b6b44f84daf8758d678da9a6eca19c909862ef | |
parent | 03c4d16662fb624a4e81dd1b18ee4bd84be8282e (diff) | |
parent | fff2194e0a6196684398d6f6efdbe426e702d067 (diff) | |
download | hercules-085c4c49df8ed8ec7d1bdf659871f63ceff7b3d3.tar.gz hercules-085c4c49df8ed8ec7d1bdf659871f63ceff7b3d3.tar.bz2 hercules-085c4c49df8ed8ec7d1bdf659871f63ceff7b3d3.tar.xz hercules-085c4c49df8ed8ec7d1bdf659871f63ceff7b3d3.zip |
Merge pull request #513 from 4144/fixassert
Fix issue http://hercules.ws/board/tracker/issue-8672-map-server-error/
-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; |