diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-13 16:33:44 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-13 16:33:44 +0000 |
commit | 81fe0ffc594681ce2fe497b6e23bcc9005ec87b9 (patch) | |
tree | 95c7561a029c7b0f270626d6d6ec7fef51c35b28 /src/map/atcommand.c | |
parent | 747ed75edefe7c74f3f0d848db5685158b94480b (diff) | |
download | hercules-81fe0ffc594681ce2fe497b6e23bcc9005ec87b9.tar.gz hercules-81fe0ffc594681ce2fe497b6e23bcc9005ec87b9.tar.bz2 hercules-81fe0ffc594681ce2fe497b6e23bcc9005ec87b9.tar.xz hercules-81fe0ffc594681ce2fe497b6e23bcc9005ec87b9.zip |
- Fixed @storeall and @charstoreall failing when the target character already had the storage open.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7656 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 2104eb1b4..7a9c2f604 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7142,9 +7142,17 @@ atcommand_storeall(const int fd, struct map_session_data* sd, {
int i;
nullpo_retr(-1, sd);
- if (storage_storageopen(sd) == 1) {
- clif_displaymessage(fd, "run this command again..");
- return 0;
+
+ if (sd->state.storage_flag != 1)
+ { //Open storage.
+ switch (storage_storageopen(sd)) {
+ case 2: //Try again
+ clif_displaymessage(fd, "run this command again..");
+ return 0;
+ case 1: //Failure
+ clif_displaymessage(fd, "You can't open the storage currently.");
+ return 1;
+ }
}
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) {
@@ -7177,11 +7185,19 @@ atcommand_charstoreall(const int fd, struct map_session_data* sd, if((pl_sd=map_nick2sd((char *) message)) == NULL)
return -1;
- if (storage_storageopen(pl_sd) == 1) {
- clif_displaymessage(fd, "Had to open the characters storage window...");
- clif_displaymessage(fd, "run this command again..");
- return 0;
+ if (pl_sd->state.storage_flag != 1)
+ { //Open storage.
+ switch (storage_storageopen(pl_sd)) {
+ case 2: //Try again
+ clif_displaymessage(fd, "Had to open the characters storage window...");
+ clif_displaymessage(fd, "run this command again..");
+ return 0;
+ case 1: //Failure
+ clif_displaymessage(fd, "The character currently can't use the storage.");
+ return 1;
+ }
}
+
for (i = 0; i < MAX_INVENTORY; i++) {
if (pl_sd->status.inventory[i].amount) {
if(pl_sd->status.inventory[i].equip != 0)
|