summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 157d9e28a..f3f554137 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -9346,11 +9346,18 @@ void pc_overheat(struct map_session_data *sd, int val) {
*/
bool pc_isautolooting(struct map_session_data *sd, int nameid)
{
- int i;
- if( !sd->state.autolooting )
+ uint8 i = 0;
+ bool j = false;
+
+ if (!sd->state.autolooting && !sd->state.autolootingtype)
return false;
- ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == nameid);
- return (i != AUTOLOOTITEM_SIZE);
+
+ if (sd->state.autolooting)
+ ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == nameid);
+ if (sd->state.autolootingtype && sd->state.autoloottype&(1<<itemdb_type(nameid)))
+ j = true;
+
+ return (i != AUTOLOOTITEM_SIZE || j );
}
/**