From 02c5517d8590c2169479a90d4c1327e85614c6fb Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 4 Sep 2006 19:06:46 +0000 Subject: - Removed status_get_sc_tick, duration and chance are now both handled by status_get_sc_def - Fixed mob-kill experience getting screwed up when characters who did damage die/logout at the moment the mob dies. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8619 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/map/mob.c') diff --git a/src/map/mob.c b/src/map/mob.c index d0d182b4e..005994e58 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1750,24 +1750,25 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) } } - for(temp=0,i=0,mvp_damage=0;idmglog[i].id;i++) + for(i=0,mvp_damage=0;idmglog[i].id;i++) { - tmpbl[temp] = (struct block_list*)map_id2bl(md->dmglog[i].id); - if(tmpbl[temp] == NULL) + tmpbl[i] = map_id2bl(md->dmglog[i].id); + if(tmpbl[i] == NULL) continue; - if( (tmpbl[temp])->m != md->bl.m || status_isdead(tmpbl[temp])) + if( (tmpbl[i])->m != md->bl.m || status_isdead(tmpbl[i])) + { + tmpbl[i] = NULL; continue; - + } if(mvp_damage<(unsigned int)md->dmglog[i].dmg){ third_sd = second_sd; second_sd = mvp_sd; - if ( (tmpbl[temp])->type == BL_HOM ) { - mvp_sd = (struct map_session_data *) ((struct homun_data *)tmpbl[temp])->master ; - } else - mvp_sd=(struct map_session_data *)tmpbl[temp]; + if ( (tmpbl[i])->type == BL_HOM ) + mvp_sd=((struct homun_data *)tmpbl[i])->master ; + else + mvp_sd=(struct map_session_data *)tmpbl[i]; mvp_damage=md->dmglog[i].dmg; } - temp++; // [Lance] } count = i; //Total number of attackers. @@ -1777,16 +1778,15 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) (!map[md->bl.m].flag.nobaseexp || !map[md->bl.m].flag.nojobexp) //Gives Exp ) { //Experience calculation. - for(i=0;idmglog[i].id;i++){ int flag=1,zeny=0; unsigned int base_exp,job_exp; double per; //Your share of the mob's exp double jper; //For the job-exp int bonus; //Bonus on top of your share. - - if (status_isdead(tmpbl[i]) || tmpbl[i]->m != md->bl.m) - continue; //When someone is dead or on another map, their share of exp is gone. - + + if (!tmpbl[i]) continue; + if (!battle_config.exp_calc_type && md->tdmg) //jAthena's exp formula based on total damage. per = (double)md->dmglog[i].dmg/(double)md->tdmg; -- cgit v1.2.3-60-g2f50