can open storage/guild storgae but can add or get item
src/map/storage.c | 41 ++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)
diff --git a/src/map/storage.c b/src/map/storage.c
index 24f0834..f694d66 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -116,12 +116,6 @@ int storage_storageopen(struct map_session_data *sd)
if(sd->state.storage_flag)
return 1; //Already open?
- if( !pc_can_give_items(sd) )
- { //check is this GM level is allowed to put items to storage
- clif_displaymessage(sd->fd, msg_txt(sd,246));
- return 1;
- }
-
sd->state.storage_flag = 1;
storage_sortitem(sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
clif_storagelist(sd, sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
@@ -164,6 +158,11 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data,
struct item_data *data;
int i;
+ if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
+ clif_displaymessage(sd->fd, msg_txt(sd,246));
+ return 1;
+ }
+
if( item_data->nameid == 0 || amount <= 0 )
return 1;
@@ -280,6 +279,11 @@ void storage_storageget(struct map_session_data* sd, int index, int amount)
{
unsigned char flag = 0;
+ if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
+ clif_displaymessage(sd->fd, msg_txt(sd,246));
+ return;
+ }
+
if( index < 0 || index >= sd->storage_size )
return;
@@ -340,6 +344,11 @@ void storage_storagegettocart(struct map_session_data* sd, int index, int amount
unsigned char flag;
nullpo_retv(sd);
+ if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
+ clif_displaymessage(sd->fd, msg_txt(sd,246));
+ return;
+ }
+
if( index < 0 || index >= sd->storage_size )
return;
@@ -461,11 +470,6 @@ int storage_guild_storageopen(struct map_session_data* sd)
if(sd->state.storage_flag)
return 1; //Can't open both storages at a time.
- if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
- clif_displaymessage(sd->fd, msg_txt(sd,246));
- return 1;
- }
-
if((gstor = guild2storage2(sd->status.guild_id)) == NULL) {
intif_request_guild_storage(sd->status.account_id,sd->status.guild_id);
return 0;
@@ -501,6 +505,11 @@ char guild_storage_additem(struct map_session_data* sd, struct guild_storage* st
nullpo_retr(1, stor);
nullpo_retr(1, item_data);
+ if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
+ clif_displaymessage(sd->fd, msg_txt(sd,246));
+ return 1;
+ }
+
if(item_data->nameid == 0 || amount <= 0)
return 1;
@@ -632,6 +641,11 @@ void storage_guild_storageget(struct map_session_data* sd, int index, int amount
if(!stor->storage_status)
return;
+ if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
+ clif_displaymessage(sd->fd, msg_txt(sd,246));
+ return;
+ }
+
if(index < 0 || index >= MAX_GUILD_STORAGE)
return;
@@ -703,6 +717,11 @@ void storage_guild_storagegettocart(struct map_session_data* sd, int index, int
nullpo_retv(sd);
nullpo_retv(stor=guild2storage2(sd->status.guild_id));
+ if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
+ clif_displaymessage(sd->fd, msg_txt(sd,246));
+ return;
+ }
+
if(!stor->storage_status)
return;
of course, not tested