summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-12 21:09:55 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-12 21:09:55 +0000
commit9c75fa7475833415c9c59e06b952157d1a64c31d (patch)
treebb9fabed69dce88ca6e4419c78b0596cc3b252ec /src
parent408c3b028d4a27442c8832c172d4030d31666f0d (diff)
downloadhercules-9c75fa7475833415c9c59e06b952157d1a64c31d.tar.gz
hercules-9c75fa7475833415c9c59e06b952157d1a64c31d.tar.bz2
hercules-9c75fa7475833415c9c59e06b952157d1a64c31d.tar.xz
hercules-9c75fa7475833415c9c59e06b952157d1a64c31d.zip
* Fixed killed monsters were assumed to be killed by homunculus only, if no damage log entries were elligible for exp distribution, even when no homunculus took part in damage dealing (bugreport:4452, since r12203).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14588 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/mob.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 1f1145846..6df6807a7 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1959,9 +1959,9 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
unsigned int base_exp,job_exp;
} pt[DAMAGELOG_SIZE];
int i,temp,count,pnum=0,m=md->bl.m;
+ int dmgbltypes = 0; // bitfield of all bl types, that caused damage to the mob and are elligible for exp distribution
unsigned int mvp_damage, tick = gettick();
- unsigned short flaghom = 1; // [Zephyrus] Does the mob only received damage from homunculus?
- bool rebirth;
+ bool rebirth, homkillonly;
status = &md->status;
@@ -2036,10 +2036,17 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
tmpsd[i] = tsd; // record as valid damage-log entry
- if(!md->dmglog[i].flag == MDLF_HOMUN && flaghom)
- flaghom = 0; // Damage received from other Types != Homunculus
+ switch( md->dmglog[i].flag )
+ {
+ case MDLF_NORMAL: dmgbltypes|= BL_PC; break;
+ case MDLF_HOMUN: dmgbltypes|= BL_HOM; break;
+ case MDLF_PET: dmgbltypes|= BL_PET; break;
+ }
}
+ // determines, if the monster was killed by homunculus' damage only
+ homkillonly = (bool)( ( dmgbltypes&BL_HOM ) && !( dmgbltypes&~BL_HOM ) );
+
if(!battle_config.exp_calc_type && count > 1)
{ //Apply first-attacker 200% exp share bonus
//TODO: Determine if this should go before calculating the MVP player instead of after.
@@ -2240,7 +2247,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
// Announce first, or else ditem will be freed. [Lance]
// By popular demand, use base drop rate for autoloot code. [Skotlex]
- mob_item_drop(md, dlist, ditem, 0, md->db->dropitem[i].p, flaghom);
+ mob_item_drop(md, dlist, ditem, 0, md->db->dropitem[i].p, homkillonly);
}
// Ore Discovery [Celest]