Fixes homunculus level up crashing the map server. bugreport:7106
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17147 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
dc9d2aa7cb
commit
0ec8a5b6c5
@ -6904,7 +6904,9 @@ ACMD_FUNC(homlevel)
|
||||
|
||||
for (i = 1; i <= level && hd->exp_next; i++){
|
||||
hd->homunculus.exp += hd->exp_next;
|
||||
merc_hom_levelup(hd);
|
||||
if( !merc_hom_levelup(hd) ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
status_calc_homunculus(hd,0);
|
||||
status_percent_heal(&hd->bl, 100, 100);
|
||||
|
@ -501,12 +501,13 @@ int merc_hom_gainexp(struct homun_data *hd,int exp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//levelup
|
||||
do
|
||||
{
|
||||
merc_hom_levelup(hd) ;
|
||||
// Do the levelup(s)
|
||||
while( hd->homunculus.exp > hd->exp_next ){
|
||||
// Max level reached or error
|
||||
if( !merc_hom_levelup(hd) ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
while(hd->homunculus.exp > hd->exp_next && hd->exp_next != 0 );
|
||||
|
||||
if( hd->exp_next == 0 )
|
||||
hd->homunculus.exp = 0 ;
|
||||
@ -999,7 +1000,10 @@ int merc_hom_shuffle(struct homun_data *hd)
|
||||
//Level it back up
|
||||
for (i = 1; i < lv && hd->exp_next; i++){
|
||||
hd->homunculus.exp += hd->exp_next;
|
||||
merc_hom_levelup(hd);
|
||||
// Should never happen, but who knows
|
||||
if( !merc_hom_levelup(hd) ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(hd->homunculus.class_ == hd->homunculusDB->evo_class) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user