summaryrefslogtreecommitdiff
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
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>
-rw-r--r--src/map/mob.h1
-rw-r--r--src/map/pc.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/map/mob.h b/src/map/mob.h
index 9b0f6ffe0..6c3aa938b 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -40,7 +40,6 @@ struct hplugin_data_store;
//The number of drops all mobs have and the max drop-slot that the steal skill will attempt to steal from.
#define MAX_MOB_DROP 10
#define MAX_MVP_DROP 3
-#define MAX_STEAL_DROP 7
//Min time between AI executions
#define MIN_MOBTHINKTIME 100
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;