summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-03 01:18:47 +0100
committerHaru <haru@dotalux.com>2013-11-03 01:21:48 +0100
commit649e7b98a7ec4fbf3363597daad3d1c57383051f (patch)
treebe7e05028610601ae574802e6dc2ac46448e4cca /src/map/pc.c
parent34b5ad00e2b7a3589040946b7825ef246bfafe99 (diff)
parentfa54cf57ded42d7b0b45a5025a8858a9b52a0074 (diff)
downloadhercules-649e7b98a7ec4fbf3363597daad3d1c57383051f.tar.gz
hercules-649e7b98a7ec4fbf3363597daad3d1c57383051f.tar.bz2
hercules-649e7b98a7ec4fbf3363597daad3d1c57383051f.tar.xz
hercules-649e7b98a7ec4fbf3363597daad3d1c57383051f.zip
Merged Pull Request #195 (@autoloottype)
- Small tweaks to the command, fixed merge conflicts Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 41f4a1a96..d98393739 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -9414,10 +9414,16 @@ 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 )
+ int i = 0;
+
+ if (sd->state.autoloottype && sd->state.autoloottype&(1<<itemdb_type(nameid)))
+ return true;
+
+ if (!sd->state.autolooting)
return false;
+
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == nameid);
+
return (i != AUTOLOOTITEM_SIZE);
}