summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Friis <peavey@inspircd.org>2009-06-22 02:10:17 +0200
committerDennis Friis <peavey@inspircd.org>2009-06-25 01:13:20 +0200
commit0fd8d8c8b8d9d1e422537369d2ea1ab677fa0a5b (patch)
tree95d635b1208393e4ce38ab0e0b3ed0645d0d4668
parent0387c5fcb62bf6f4a18f02b9d637d3e0d9f8dfad (diff)
downloadtmwa-0fd8d8c8b8d9d1e422537369d2ea1ab677fa0a5b.tar.gz
tmwa-0fd8d8c8b8d9d1e422537369d2ea1ab677fa0a5b.tar.bz2
tmwa-0fd8d8c8b8d9d1e422537369d2ea1ab677fa0a5b.tar.xz
tmwa-0fd8d8c8b8d9d1e422537369d2ea1ab677fa0a5b.zip
Fixes for @storage / @gstorage ATcommands. Derived from ea stable.
-rw-r--r--src/map/atcommand.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 85ff15c..2283961 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1453,6 +1453,19 @@ int atcommand_storage(
const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
+ struct storage *stor; //changes from Freya/Yor
+ nullpo_retr(-1, sd);
+
+ if (sd->state.storage_flag == 1) {
+ clif_displaymessage(fd, "You have opened your guild storage. Close it before.");
+ return -1;
+ }
+
+ if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) {
+ clif_displaymessage(fd, "You have already opened your storage.");
+ return -1;
+ }
+
storage_storageopen(sd);
return 0;
@@ -1466,8 +1479,23 @@ int atcommand_guildstorage(
const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
- if (sd->status.guild_id > 0)
+ struct storage *stor; //changes from Freya/Yor
+ nullpo_retr(-1, sd);
+
+ if (sd->status.guild_id > 0) {
+ if (sd->state.storage_flag == 1) {
+ clif_displaymessage(fd, "You have already opened your guild storage.");
+ return -1;
+ }
+ if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) {
+ clif_displaymessage(fd, "Your storage is opened. Close it before.");
+ return -1;
+ }
storage_guild_storageopen(sd);
+ } else {
+ clif_displaymessage(fd, "You are not in a guild.");
+ return -1;
+ }
return 0;
}