summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-20 16:32:47 -0300
committershennetsind <ind@henn.et>2013-06-20 16:32:47 -0300
commit0f7c29113d7d898150108d66d1358f15bb018e0a (patch)
tree7860de32323fcad0dc9519e0cd7b877d2172aac8 /src/map/atcommand.c
parentc461dc00be5182be312b04b0e0cb87b37874e02c (diff)
downloadhercules-0f7c29113d7d898150108d66d1358f15bb018e0a.tar.gz
hercules-0f7c29113d7d898150108d66d1358f15bb018e0a.tar.bz2
hercules-0f7c29113d7d898150108d66d1358f15bb018e0a.tar.xz
hercules-0f7c29113d7d898150108d66d1358f15bb018e0a.zip
Hercules Renewal Phase One: storage.c
2 new interfaces: - storage - gstorage http://hercules.ws/board/topic/237-hercules-renewal/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index b6a9e42ee..52192ebdc 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -816,8 +816,7 @@ ACMD(storage)
if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag)
return false;
- if (storage_storageopen(sd) == 1)
- { //Already open.
+ if (storage->open(sd) == 1) { //Already open.
clif->message(fd, msg_txt(250));
return false;
}
@@ -853,7 +852,7 @@ ACMD(guildstorage)
return false;
}
- storage_guild_storageopen(sd);
+ gstorage->open(sd);
clif->message(fd, msg_txt(920)); // Guild storage opened.
return true;
}
@@ -5233,7 +5232,7 @@ ACMD(storeall)
if (sd->state.storage_flag != 1)
{ //Open storage.
- if( storage_storageopen(sd) == 1 ) {
+ if( storage->open(sd) == 1 ) {
clif->message(fd, msg_txt(1161)); // You currently cannot open your storage.
return false;
}
@@ -5243,10 +5242,10 @@ ACMD(storeall)
if (sd->status.inventory[i].amount) {
if(sd->status.inventory[i].equip != 0)
pc->unequipitem(sd, i, 3);
- storage_storageadd(sd, i, sd->status.inventory[i].amount);
+ storage->add(sd, i, sd->status.inventory[i].amount);
}
}
- storage_storageclose(sd);
+ storage->close(sd);
clif->message(fd, msg_txt(1162)); // All items stored.
return true;
@@ -5264,9 +5263,9 @@ ACMD(clearstorage)
j = sd->status.storage.storage_amount;
for (i = 0; i < j; ++i) {
- storage_delitem(sd, i, sd->status.storage.items[i].amount);
+ storage->delitem(sd, i, sd->status.storage.items[i].amount);
}
- storage_storageclose(sd);
+ storage->close(sd);
clif->message(fd, msg_txt(1394)); // Your storage was cleaned.
return true;
@@ -5276,7 +5275,7 @@ ACMD(cleargstorage)
{
int i, j;
struct guild *g;
- struct guild_storage *gstorage;
+ struct guild_storage *guild_storage;
nullpo_retr(-1, sd);
g = sd->guild;
@@ -5296,18 +5295,18 @@ ACMD(cleargstorage)
return false;
}
- gstorage = guild2storage2(sd->status.guild_id);
- if (gstorage == NULL) {// Doesn't have opened @gstorage yet, so we skip the deletion since *shouldn't* have any item there.
+ guild_storage = gstorage->id2storage2(sd->status.guild_id);
+ if (guild_storage == NULL) {// Doesn't have opened @gstorage yet, so we skip the deletion since *shouldn't* have any item there.
return false;
}
- j = gstorage->storage_amount;
- gstorage->lock = 1; // Lock @gstorage: do not allow any item to be retrieved or stored from any guild member
+ j = guild_storage->storage_amount;
+ guild_storage->lock = 1; // Lock @gstorage: do not allow any item to be retrieved or stored from any guild member
for (i = 0; i < j; ++i) {
- guild_storage_delitem(sd, gstorage, i, gstorage->items[i].amount);
+ gstorage->delitem(sd, guild_storage, i, guild_storage->items[i].amount);
}
- storage_guild_storageclose(sd);
- gstorage->lock = 0; // Cleaning done, release lock
+ gstorage->close(sd);
+ guild_storage->lock = 0; // Cleaning done, release lock
clif->message(fd, msg_txt(1395)); // Your guild storage was cleaned.
return true;