diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-08 10:06:14 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-08 10:06:14 +0000 |
commit | 4ea76daf4972bdcf58483a6c20f71700d58cf561 (patch) | |
tree | 49c862af667b8f9f269c6db8aca551c97e340b74 | |
parent | da8235bf4bee99b8b109f78835caec45d30421d9 (diff) | |
download | hercules-4ea76daf4972bdcf58483a6c20f71700d58cf561.tar.gz hercules-4ea76daf4972bdcf58483a6c20f71700d58cf561.tar.bz2 hercules-4ea76daf4972bdcf58483a6c20f71700d58cf561.tar.xz hercules-4ea76daf4972bdcf58483a6c20f71700d58cf561.zip |
Fixed crash with supernovices with 100% base exp
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@511 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog.txt | 2 | ||||
-rw-r--r-- | src/map/clif.c | 39 | ||||
-rw-r--r-- | src/map/pc.c | 8 |
3 files changed, 29 insertions, 20 deletions
diff --git a/Changelog.txt b/Changelog.txt index 54b4431b4..81f5bf21c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,8 @@ Date Added 12/8 + * Fixed crash with supernovices with 100% base exp [celest] * Updated the readme a little. [Mass Zero] + 12/7 * Added GUILDCACHE #define to int_guild.c for testing performance effects [MouseJstr] diff --git a/src/map/clif.c b/src/map/clif.c index 716eb28ac..d4f94504c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7729,24 +7729,27 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c < WFIFOSET(fd, WFIFOW(fd,2)); // Celest - if (pc_calc_base_job2 (sd->status.class) == 23 && (sd->status.base_exp*100/pc_nextbaseexp(sd))%10 == 0) { - estr_lower(RFIFOP(fd,4)); - if (sd->state.snovice_flag == 0 && strstr(RFIFOP(fd,4), "guardian angel, can you hear my voice? ^^;")) - sd->state.snovice_flag = 1; - else if (sd->state.snovice_flag == 1) { - sprintf(message, "my name is %s, and i'm a super novice~", sd->status.name); - estr_lower(message); - if (strstr(RFIFOP(fd,4), message)) - sd->state.snovice_flag = 2; - } - else if (sd->state.snovice_flag == 2 && strstr(RFIFOP(fd,4), "please help me~ t.t")) - sd->state.snovice_flag = 3; - else if (sd->state.snovice_flag == 3) { - int i; - skill_status_change_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],1,0,0,0,skill_get_time(MO_EXPLOSIONSPIRITS,1),0 ); - for(i=0;i<5;i++) - pc_addspiritball(sd,skill_get_time(MO_CALLSPIRITS,1),5); - sd->state.snovice_flag = 0; + if (pc_calc_base_job2 (sd->status.class) == 23 ) { + int next = pc_nextbaseexp(sd)>0 ? pc_nextbaseexp(sd) : sd->status.base_exp; + if ((sd->status.base_exp*100/next)%10 == 0) { + estr_lower(RFIFOP(fd,4)); + if (sd->state.snovice_flag == 0 && strstr(RFIFOP(fd,4), "guardian angel, can you hear my voice? ^^;")) + sd->state.snovice_flag = 1; + else if (sd->state.snovice_flag == 1) { + sprintf(message, "my name is %s, and i'm a super novice~", sd->status.name); + estr_lower(message); + if (strstr(RFIFOP(fd,4), message)) + sd->state.snovice_flag = 2; + } + else if (sd->state.snovice_flag == 2 && strstr(RFIFOP(fd,4), "please help me~ t.t")) + sd->state.snovice_flag = 3; + else if (sd->state.snovice_flag == 3) { + int i; + skill_status_change_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],1,0,0,0,skill_get_time(MO_EXPLOSIONSPIRITS,1),0 ); + for(i=0;i<5;i++) + pc_addspiritball(sd,skill_get_time(MO_CALLSPIRITS,1),5); + sd->state.snovice_flag = 0; + } } } diff --git a/src/map/pc.c b/src/map/pc.c index ca8d3b602..3fb63c57b 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5433,8 +5433,12 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) pc_calcstatus(sd,0); // activate Steel body if a super novice dies at 99+% exp [celest] - if (s_class.job == 23 && (i=sd->status.base_exp*1000/pc_nextbaseexp(sd))>=990 && i<=1000) - sd->state.snovice_flag = 4; + if (s_class.job == 23) { + if ((i=pc_nextbaseexp(sd))<=0) + i=sd->status.base_exp; + if ((j=sd->status.base_exp*1000/i)>=990 && j<=1000) + sd->state.snovice_flag = 4; + } for(i=0;i<5;i++) if(sd->dev.val1[i]){ |