summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-13 16:14:32 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-13 16:14:32 +0000
commitfb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63 (patch)
tree52b66f102c20e6b47e060efe0e7ceabd36d5aa29 /src/map/atcommand.c
parent2e7ba13554118cdc78c9bfa5a6f0e5e8e58baf7b (diff)
downloadhercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.gz
hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.bz2
hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.xz
hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.zip
Modified storage data loading
* storage is now loaded/saved along with character status * as a consequence, a lot of storage handling code was removed * there is no more locking done within storage data * mapservers no longer cache the data (solves muiltimapserver exploit) * loading storage on char select may decrease charserver performance git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12950 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index b47665bf5..3db3bb9f8 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1155,7 +1155,6 @@ int atcommand_storage(const int fd, struct map_session_data* sd, const char* com
*------------------------------------------*/
int atcommand_guildstorage(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
- struct storage_data *stor; //changes from Freya/Yor
nullpo_retr(-1, sd);
if (!sd->status.guild_id) {
@@ -1163,18 +1162,19 @@ int atcommand_guildstorage(const int fd, struct map_session_data* sd, const char
return -1;
}
- if (sd->npc_id || sd->vender_id || sd->state.trading || sd->state.storage_flag)
+ if (sd->npc_id || sd->vender_id || sd->state.trading)
return -1;
- if (sd->state.storage_flag) {
- clif_displaymessage(fd, msg_txt(251));
+ if (sd->state.storage_flag == 1) {
+ clif_displaymessage(fd, msg_txt(250));
return -1;
}
- if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) {
+ if (sd->state.storage_flag == 2) {
clif_displaymessage(fd, msg_txt(251));
return -1;
}
+
storage_guild_storageopen(sd);
clif_displaymessage(fd, "Guild storage opened.");
return 0;
@@ -5547,15 +5547,12 @@ int atcommand_storeall(const int fd, struct map_session_data* sd, const char* co
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
+ if( storage_storageopen(sd) == 1 ) {
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) {
if(sd->status.inventory[i].equip != 0)