Fixed crash with supernovices with 100% base exp

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@511 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
celest 2004-12-08 10:06:14 +00:00
parent 7659b79f23
commit 71697f98c5
3 changed files with 29 additions and 20 deletions

View File

@ -1,6 +1,8 @@
Date Added Date Added
12/8 12/8
* Fixed crash with supernovices with 100% base exp [celest]
* Updated the readme a little. [Mass Zero] * Updated the readme a little. [Mass Zero]
12/7 12/7
* Added GUILDCACHE #define to int_guild.c for testing performance * Added GUILDCACHE #define to int_guild.c for testing performance
effects [MouseJstr] effects [MouseJstr]

View File

@ -7729,7 +7729,9 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
WFIFOSET(fd, WFIFOW(fd,2)); WFIFOSET(fd, WFIFOW(fd,2));
// Celest // Celest
if (pc_calc_base_job2 (sd->status.class) == 23 && (sd->status.base_exp*100/pc_nextbaseexp(sd))%10 == 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)); estr_lower(RFIFOP(fd,4));
if (sd->state.snovice_flag == 0 && strstr(RFIFOP(fd,4), "guardian angel, can you hear my voice? ^^;")) if (sd->state.snovice_flag == 0 && strstr(RFIFOP(fd,4), "guardian angel, can you hear my voice? ^^;"))
sd->state.snovice_flag = 1; sd->state.snovice_flag = 1;
@ -7749,6 +7751,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
sd->state.snovice_flag = 0; sd->state.snovice_flag = 0;
} }
} }
}
if(message) free(message); if(message) free(message);
if(buf) free(buf); if(buf) free(buf);

View File

@ -5433,8 +5433,12 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
pc_calcstatus(sd,0); pc_calcstatus(sd,0);
// activate Steel body if a super novice dies at 99+% exp [celest] // 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) 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; sd->state.snovice_flag = 4;
}
for(i=0;i<5;i++) for(i=0;i<5;i++)
if(sd->dev.val1[i]){ if(sd->dev.val1[i]){