diff options
author | skyleo <skyleo@skyleo.de> | 2018-11-19 10:20:06 +0100 |
---|---|---|
committer | skyleo <skyleo@skyleo.de> | 2018-11-20 11:58:10 +0100 |
commit | 63b62712347f5995a2ff01e67b0b4f86838857d5 (patch) | |
tree | 117e3bcbe6adc7f9bdba3d1fe96bbd6cfb30868e /src/map/mob.c | |
parent | 5e37ad2204e8d3fc3069cfa96fe9739685f2f7a0 (diff) | |
download | hercules-63b62712347f5995a2ff01e67b0b4f86838857d5.tar.gz hercules-63b62712347f5995a2ff01e67b0b4f86838857d5.tar.bz2 hercules-63b62712347f5995a2ff01e67b0b4f86838857d5.tar.xz hercules-63b62712347f5995a2ff01e67b0b4f86838857d5.zip |
Change short group to bool is_group in s_add_drop
current checks for empty entries assumed that if id and group is 0 that
it is empty, while in fact ITMCHAIN_ORE has group 0 as value,
for easier checks and more aesthetic code short group has been
replaced, id's are now always written into short id and bool
is_group decides if it's an item or a group.
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 765acafe7..d82e49bcc 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2546,7 +2546,7 @@ static int mob_dead(struct mob_data *md, struct block_list *src, int type) if(sd) { // process script-granted extra drop bonuses int itemid = 0; - for (i = 0; i < ARRAYLENGTH(sd->add_drop) && (sd->add_drop[i].id || sd->add_drop[i].group); i++) + for (i = 0; i < ARRAYLENGTH(sd->add_drop) && (sd->add_drop[i].id != 0 || sd->add_drop[i].is_group); i++) { if ( sd->add_drop[i].race == -md->class_ || ( sd->add_drop[i].race > 0 && ( @@ -2568,7 +2568,7 @@ static int mob_dead(struct mob_data *md, struct block_list *src, int type) if (rnd()%10000 >= drop_rate) continue; - itemid = (sd->add_drop[i].id > 0) ? sd->add_drop[i].id : itemdb->chain_item(sd->add_drop[i].group,&drop_rate); + itemid = (!sd->add_drop[i].is_group) ? sd->add_drop[i].id : itemdb->chain_item(sd->add_drop[i].id, &drop_rate); if( itemid ) mob->item_drop(md, dlist, mob->setdropitem(itemid,1,NULL), 0, drop_rate, homkillonly); } |