For performance reasons, I'd do the autolootingtype check (and return if successful) before iterating the autolootid array. It saves an array iteration (and the existence of the j variable as well) when not necessary.

Something like:

```
 bool pc_isautolooting(struct map_session_data *sd, int nameid)
 {
     int i;

+    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);
 }
```