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++){
|
for (i = 1; i <= level && hd->exp_next; i++){
|
||||||
hd->homunculus.exp += hd->exp_next;
|
hd->homunculus.exp += hd->exp_next;
|
||||||
merc_hom_levelup(hd);
|
if( !merc_hom_levelup(hd) ){
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
status_calc_homunculus(hd,0);
|
status_calc_homunculus(hd,0);
|
||||||
status_percent_heal(&hd->bl, 100, 100);
|
status_percent_heal(&hd->bl, 100, 100);
|
||||||
|
@ -501,12 +501,13 @@ int merc_hom_gainexp(struct homun_data *hd,int exp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//levelup
|
// Do the levelup(s)
|
||||||
do
|
while( hd->homunculus.exp > hd->exp_next ){
|
||||||
{
|
// Max level reached or error
|
||||||
merc_hom_levelup(hd) ;
|
if( !merc_hom_levelup(hd) ){
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while(hd->homunculus.exp > hd->exp_next && hd->exp_next != 0 );
|
|
||||||
|
|
||||||
if( hd->exp_next == 0 )
|
if( hd->exp_next == 0 )
|
||||||
hd->homunculus.exp = 0 ;
|
hd->homunculus.exp = 0 ;
|
||||||
@ -999,7 +1000,10 @@ int merc_hom_shuffle(struct homun_data *hd)
|
|||||||
//Level it back up
|
//Level it back up
|
||||||
for (i = 1; i < lv && hd->exp_next; i++){
|
for (i = 1; i < lv && hd->exp_next; i++){
|
||||||
hd->homunculus.exp += hd->exp_next;
|
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) {
|
if(hd->homunculus.class_ == hd->homunculusDB->evo_class) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user