From 8f8e2e42ba3ea1416b80190a3006c061ef4ed8b5 Mon Sep 17 00:00:00 2001 From: skotlex Date: Sun, 11 Mar 2007 20:02:42 +0000 Subject: - @storage/@gstorage will no longer work if you have a trade or a storage opened already. - Cleaned up a bit @gstorage - Added a bunch of npc functions required to properly handle moving the NPC cells when an npc is moved from it's previous location. - Added npc_setcells to handle setting down the NPC cells of ontouch npcs. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9990 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index fbd7a28ff..64396fa4b 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2163,6 +2163,9 @@ int atcommand_charspeed(const int fd, struct map_session_data* sd, const char* c int atcommand_storage(const int fd, struct map_session_data* sd, const char* command, const char* message) { nullpo_retr(-1, sd); + + if (sd->npc_id || sd->vender_id || sd->state.trading || sd->state.storage_flag) + return -1; if (storage_storageopen(sd) == 1) { //Already open. @@ -2182,21 +2185,24 @@ int atcommand_guildstorage(const int fd, struct map_session_data* sd, const char struct storage *stor; //changes from Freya/Yor nullpo_retr(-1, sd); - if (sd->status.guild_id > 0) { - if (sd->state.storage_flag) { - clif_displaymessage(fd, msg_txt(251)); - return -1; - } - if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) { - clif_displaymessage(fd, msg_txt(251)); - return -1; - } - storage_guild_storageopen(sd); - } else { + if (!sd->status.guild_id) { clif_displaymessage(fd, msg_txt(252)); return -1; } + if (sd->npc_id || sd->vender_id || sd->state.trading || sd->state.storage_flag) + return -1; + + if (sd->state.storage_flag) { + clif_displaymessage(fd, msg_txt(251)); + return -1; + } + + if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) { + clif_displaymessage(fd, msg_txt(251)); + return -1; + } + storage_guild_storageopen(sd); return 0; } -- cgit v1.2.3-60-g2f50