summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkotlex <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-08-11 15:50:44 +0000
committerSkotlex <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-08-11 15:50:44 +0000
commitca008d79a6b5024e55cd5423e577974a5017704c (patch)
treede9ed6833daab33b4c71b3c6d3ee9f49f4d8349e
parentecf7124424ce3a052123fb29407fb2114d168843 (diff)
downloadhercules-ca008d79a6b5024e55cd5423e577974a5017704c.tar.gz
hercules-ca008d79a6b5024e55cd5423e577974a5017704c.tar.bz2
hercules-ca008d79a6b5024e55cd5423e577974a5017704c.tar.xz
hercules-ca008d79a6b5024e55cd5423e577974a5017704c.zip
- Fixed the add_drop code breakage which ocurred after adding support for SP_ADD_CLASS_DROP_ITEM. There's probably a bugreport for this, but the website is also broken currently :3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14933 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/mob.c9
-rw-r--r--src/map/pc.c5
3 files changed, 10 insertions, 6 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 256b2f0e1..a8960b164 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,5 +1,7 @@
Date Added
+2011/08/11
+ * Fixed bonuses bAddMonsterDropItem and bAddMonsterDropItemGroup (which broke after bAddClassDropItem was added). [Skotlex]
2011/08/10
* Added support for cash shop packets without kafra points for clients 2007-07-10aSakexe and older (bugreport:4701, related r10888 and r11548). [Ai4rei]
* Added sending a dummy 0x08b9 packet (PIN auth system) in the char-server, required to support clients from this year. [Skotlex]
diff --git a/src/map/mob.c b/src/map/mob.c
index 9b83440dd..3bfa7dfa7 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2259,10 +2259,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
int itemid = 0;
for (i = 0; i < ARRAYLENGTH(sd->add_drop) && (sd->add_drop[i].id || sd->add_drop[i].group); i++)
{
- if ( ( sd->add_drop[i].race <= (1<<status->race) &&
- sd->add_drop[i].race & (1<<status->race) ||
- sd->add_drop[i].race & 1<<(status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS) ) ||
- ( sd->add_drop[i].race > (1<<RC_MAX) && sd->add_drop[i].race == md->class_) )
+ if ( sd->add_drop[i].race == -md->class_ ||
+ ( sd->add_drop[i].race > 0 && (
+ sd->add_drop[i].race & (1<<status->race) ||
+ sd->add_drop[i].race & (1<<(status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS))
+ )))
{
//check if the bonus item drop rate should be multiplied with mob level/10 [Lupus]
if(sd->add_drop[i].rate < 0) {
diff --git a/src/map/pc.c b/src/map/pc.c
index 30bde19df..2de4c28de 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1608,7 +1608,8 @@ static int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id
for(i = 0; i < max && (drop[i].id || drop[i].group); i++) {
if(
((id && drop[i].id == id) ||
- (group && drop[i].group == group)) && race < (RC_MAX<<1)
+ (group && drop[i].group == group))
+ && race > 0
) {
drop[i].race |= race;
if(drop[i].rate > 0 && rate > 0)
@@ -2855,7 +2856,7 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
break;
case SP_ADD_CLASS_DROP_ITEM:
if(sd->state.lr_flag != 2)
- pc_bonus_item_drop(sd->add_drop, ARRAYLENGTH(sd->add_drop), type2, 0, type3, val);
+ pc_bonus_item_drop(sd->add_drop, ARRAYLENGTH(sd->add_drop), type2, 0, -type3, val);
break;
case SP_AUTOSPELL:
if(sd->state.lr_flag != 2)