summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Friis <peavey@inspircd.org>2009-06-25 01:00:54 +0200
committerDennis Friis <peavey@inspircd.org>2009-06-25 01:13:21 +0200
commit01164c90ef975e90f8eac9bebc77e0ff93fbcf52 (patch)
tree669c71bc5a5d23beef58d946543938482f0c3c42
parent9478575520ed4ee5d36c4996522171cb35aab756 (diff)
downloadtmwa-01164c90ef975e90f8eac9bebc77e0ff93fbcf52.tar.gz
tmwa-01164c90ef975e90f8eac9bebc77e0ff93fbcf52.tar.bz2
tmwa-01164c90ef975e90f8eac9bebc77e0ff93fbcf52.tar.xz
tmwa-01164c90ef975e90f8eac9bebc77e0ff93fbcf52.zip
Move storage NPC close fix to storage.c. Fix @storeall, from ea stable.
-rw-r--r--src/map/atcommand.c15
-rw-r--r--src/map/clif.c5
-rw-r--r--src/map/storage.c6
3 files changed, 18 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index e85ca7d..74567bb 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6520,9 +6520,18 @@ atcommand_storeall(const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
int i;
- if (storage_storageopen(sd) == 1) {
- clif_displaymessage(fd, "run this command again..");
- return 0;
+ nullpo_retr(-1, sd);
+
+ 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) {
diff --git a/src/map/clif.c b/src/map/clif.c
index c234966..d10effb 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7608,11 +7608,6 @@ void clif_parse_CloseKafra(int fd, struct map_session_data *sd) {
storage_storageclose(sd);
else if (sd->state.storage_flag == 2)
storage_guild_storageclose(sd);
-
- if (sd->npc_flags.storage) {
- sd->npc_flags.storage = 0;
- map_scriptcont(sd, sd->npc_id);
- }
}
/*==========================================
diff --git a/src/map/storage.c b/src/map/storage.c
index 7a7c893..53b5bc7 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -367,6 +367,12 @@ int storage_storageclose(struct map_session_data *sd)
}
stor->storage_status=0;
sd->state.storage_flag=0;
+
+ if (sd->npc_flags.storage) {
+ sd->npc_flags.storage = 0;
+ map_scriptcont(sd, sd->npc_id);
+ }
+
return 0;
}