From 9fef13d4d2e0eab3376ea95b3cb8783d48d19dda Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 21 Nov 2015 15:44:24 +0100 Subject: Refactored/fixed race handling for bonuses that store it as a bitmask - The following bonuses now work correctly with RC_DemiPlayer, RC_NonDemiPlayer, RC_NonDemiHuman, RC_Nonplayer: * bIgnoreDefRace * bIgnoreMdefRace * bDefRatioAtkRace * bAddMonsterDropChainItem (bonus3) * bAddMonsterDropItem (bonus3) - A new function (map->race_id2mask) is provided, to easily and efficiently generate a bitmask from a race ID. - The RC_ALL race ID is mapped to RC_BOSS and RC_NONBOSS, for backwards compatibility. Signed-off-by: Haru --- src/map/mob.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/map/mob.c') diff --git a/src/map/mob.c b/src/map/mob.c index 6cbbd3a2a..d9a3f6776 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2411,8 +2411,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { { if ( sd->add_drop[i].race == -md->class_ || ( sd->add_drop[i].race > 0 && ( - sd->add_drop[i].race & (1<race) || - sd->add_drop[i].race & (1<<((mstatus->mode&MD_BOSS)?RC_BOSS:RC_NONBOSS)) + sd->add_drop[i].race & map->race_id2mask(mstatus->race) || + sd->add_drop[i].race & map->race_id2mask((mstatus->mode&MD_BOSS) ? RC_BOSS : RC_NONBOSS) ))) { //check if the bonus item drop rate should be multiplied with mob level/10 [Lupus] -- cgit v1.2.3-70-g09d2