summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-09 03:27:59 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-09 03:27:59 +0000
commit33af82efa149ada28596fa6b815cc66605577b98 (patch)
tree1b17b374c0f4f0a4f2438633c2ad6e7f9b809d90 /src/map/atcommand.c
parent2685644efe22ad7b250d1c3de02141993f287d38 (diff)
downloadhercules-33af82efa149ada28596fa6b815cc66605577b98.tar.gz
hercules-33af82efa149ada28596fa6b815cc66605577b98.tar.bz2
hercules-33af82efa149ada28596fa6b815cc66605577b98.tar.xz
hercules-33af82efa149ada28596fa6b815cc66605577b98.zip
Added minor autolootitem code improvement. saves from scenarios like:
Kill a monsters on a aoe, with 10 drops looking up a empty autolootitem array -- 100 times ? -- (10 per loot with AUTOLOOITEM_SIZE as 10). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15556 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 64b005aae..c4dcba902 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6280,6 +6280,7 @@ ACMD_FUNC(autolootitem)
sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated
sprintf(atcmd_output, "Autolooting item: '%s'/'%s' {%d}", item_data->name, item_data->jname, item_data->nameid);
clif_displaymessage(fd, atcmd_output);
+ sd->state.autolooting = 1;
break;
case 2:
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
@@ -6290,6 +6291,10 @@ ACMD_FUNC(autolootitem)
sd->state.autolootid[i] = 0;
sprintf(atcmd_output, "Removed item: '%s'/'%s' {%d} from your autolootitem list.", item_data->name, item_data->jname, item_data->nameid);
clif_displaymessage(fd, atcmd_output);
+ ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
+ if (i == AUTOLOOTITEM_SIZE) {
+ sd->state.autolooting = 0;
+ }
break;
case 3:
sprintf(atcmd_output, "You can have %d items on your autolootitem list.", AUTOLOOTITEM_SIZE);
@@ -6317,6 +6322,7 @@ ACMD_FUNC(autolootitem)
case 4:
memset(sd->state.autolootid, 0, sizeof(sd->state.autolootid));
clif_displaymessage(fd, "Your autolootitem list has been reset.");
+ sd->state.autolooting = 0;
break;
}
return 0;