summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-08-25 20:27:34 +0200
committerHaru <haru@dotalux.com>2019-10-22 18:23:41 +0200
commit22b946b2db0374164697ba57b64abb11551b0ff3 (patch)
treedcd4fe991429cd048143ab8c6f7ad4598a53adfb /src/map/pc.c
parent795eb7e51203db91594b659e54b133a585aa38cb (diff)
downloadhercules-22b946b2db0374164697ba57b64abb11551b0ff3.tar.gz
hercules-22b946b2db0374164697ba57b64abb11551b0ff3.tar.bz2
hercules-22b946b2db0374164697ba57b64abb11551b0ff3.tar.xz
hercules-22b946b2db0374164697ba57b64abb11551b0ff3.zip
Fix Steal accidentally being able to steal cards from certain mobs
Cards are now blocked by item type rather than item drop slot position, since cards no longer have a fixed position in the drop list (regression in ed72a947a6c97804c1eef5b80bfa49d99f7d7586) Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index a8ff661e8..56a00b5ce 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5583,15 +5583,17 @@ static int pc_steal_item(struct map_session_data *sd, struct block_list *bl, uin
// Try dropping one item, in the order from first to last possible slot.
// Droprate is affected by the skill success rate.
- for (i = 0; i < MAX_STEAL_DROP; i++) {
+ for (i = 0; i < MAX_MOB_DROP; i++) {
if (md->db->dropitem[i].nameid == 0)
continue;
if ((data = itemdb->exists(md->db->dropitem[i].nameid)) == NULL)
continue;
+ if (data->type == IT_CARD)
+ continue;
if (rnd() % 10000 < apply_percentrate(md->db->dropitem[i].p, rate, 100))
break;
}
- if (i == MAX_STEAL_DROP)
+ if (i == MAX_MOB_DROP)
return 0;
itemid = md->db->dropitem[i].nameid;