diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-04 19:06:46 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-04 19:06:46 +0000 |
commit | 02c5517d8590c2169479a90d4c1327e85614c6fb (patch) | |
tree | 43b11f63f8490930bf5543cba83565f7a4d51be7 /src/map/mob.c | |
parent | b8916a91b4a7200c2ee36a155a9c3ddbfa847831 (diff) | |
download | hercules-02c5517d8590c2169479a90d4c1327e85614c6fb.tar.gz hercules-02c5517d8590c2169479a90d4c1327e85614c6fb.tar.bz2 hercules-02c5517d8590c2169479a90d4c1327e85614c6fb.tar.xz hercules-02c5517d8590c2169479a90d4c1327e85614c6fb.zip |
- 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
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 30 |
1 files changed, 15 insertions, 15 deletions
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;i<DAMAGELOG_SIZE && md->dmglog[i].id;i++) + for(i=0,mvp_damage=0;i<DAMAGELOG_SIZE && md->dmglog[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;i<DAMAGELOG_SIZE && tmpbl[i];i++){ + for(i=0;i<DAMAGELOG_SIZE && md->dmglog[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; |