summaryrefslogtreecommitdiff
path: root/src/map/storage.c
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-11 17:35:28 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-11 17:35:28 +0000
commite782bd5f2f7cd73634dfd8616a351a1b97c2109c (patch)
tree319366658d419bed37df23fc67b1c80957a141f4 /src/map/storage.c
parente18603bb1985d5628f1213999e92eaed8d008eb1 (diff)
downloadhercules-e782bd5f2f7cd73634dfd8616a351a1b97c2109c.tar.gz
hercules-e782bd5f2f7cd73634dfd8616a351a1b97c2109c.tar.bz2
hercules-e782bd5f2f7cd73634dfd8616a351a1b97c2109c.tar.xz
hercules-e782bd5f2f7cd73634dfd8616a351a1b97c2109c.zip
Picklog improvements:
- now it is finally possible to log every item players gain or lose - added 3 log types: `I` for auctioned items, `B` for buying shop transactions and `X` for all other items transactions that don't fall into another category (for detailed explanation on all log types read `conf/log_athena.conf`) - it also fixes items being logged as picked up/gained by player when in fact they were dropped on the ground due to full inventory git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15420 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/storage.c')
-rw-r--r--src/map/storage.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/map/storage.c b/src/map/storage.c
index dd14acfda..a7aab8d79 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -154,7 +154,6 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data,
return 1;
stor->items[i].amount += amount;
clif_storageitemadded(sd,&stor->items[i],i,amount);
- log_pick_pc(sd, LOG_TYPE_STORAGE, item_data->nameid, -amount, item_data);
return 0;
}
}
@@ -171,7 +170,6 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data,
stor->items[i].amount = amount;
clif_storageitemadded(sd,&stor->items[i],i,amount);
clif_updatestorageamount(sd,stor->storage_amount);
- log_pick_pc(sd, LOG_TYPE_STORAGE, item_data->nameid, -amount, item_data);
return 0;
}
@@ -185,9 +183,6 @@ int storage_delitem(struct map_session_data* sd, int n, int amount)
return 1;
sd->status.storage.items[n].amount -= amount;
-
- log_pick_pc(sd, LOG_TYPE_STORAGE, sd->status.storage.items[n].nameid, amount, &sd->status.storage.items[n]);
-
if( sd->status.storage.items[n].amount == 0 )
{
memset(&sd->status.storage.items[n],0,sizeof(sd->status.storage.items[0]));
@@ -218,7 +213,7 @@ int storage_storageadd(struct map_session_data* sd, int index, int amount)
return 0;
if( storage_additem(sd,&sd->status.inventory[index],amount) == 0 )
- pc_delitem(sd,index,amount,0,4);
+ pc_delitem(sd,index,amount,0,4,LOG_TYPE_STORAGE);
return 1;
}
@@ -239,7 +234,7 @@ int storage_storageget(struct map_session_data* sd, int index, int amount)
if( amount < 1 || amount > sd->status.storage.items[index].amount )
return 0;
- if( (flag = pc_additem(sd,&sd->status.storage.items[index],amount)) == 0 )
+ if( (flag = pc_additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE)) == 0 )
storage_delitem(sd,index,amount);
else
clif_additem(sd,0,0,flag);
@@ -267,7 +262,7 @@ int storage_storageaddfromcart(struct map_session_data* sd, int index, int amoun
return 0;
if( storage_additem(sd,&sd->status.cart[index],amount) == 0 )
- pc_cart_delitem(sd,index,amount,0);
+ pc_cart_delitem(sd,index,amount,0,LOG_TYPE_STORAGE);
return 1;
}
@@ -288,7 +283,7 @@ int storage_storagegettocart(struct map_session_data* sd, int index, int amount)
if( amount < 1 || amount > sd->status.storage.items[index].amount )
return 0;
- if( pc_cart_additem(sd,&sd->status.storage.items[index],amount) == 0 )
+ if( pc_cart_additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE) == 0 )
storage_delitem(sd,index,amount);
return 1;
@@ -410,7 +405,6 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
stor->items[i].amount+=amount;
clif_storageitemadded(sd,&stor->items[i],i,amount);
stor->dirty = 1;
- log_pick_pc(sd, LOG_TYPE_GSTORAGE, item_data->nameid, -amount, item_data);
return 0;
}
}
@@ -427,7 +421,6 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
clif_storageitemadded(sd,&stor->items[i],i,amount);
clif_updateguildstorageamount(sd,stor->storage_amount);
stor->dirty = 1;
- log_pick_pc(sd, LOG_TYPE_GSTORAGE, item_data->nameid, -amount, item_data);
return 0;
}
@@ -440,7 +433,6 @@ int guild_storage_delitem(struct map_session_data* sd, struct guild_storage* sto
return 1;
stor->items[n].amount-=amount;
- log_pick_pc(sd, LOG_TYPE_GSTORAGE, stor->items[n].nameid, amount, &stor->items[n]);
if(stor->items[n].amount==0){
memset(&stor->items[n],0,sizeof(stor->items[0]));
stor->storage_amount--;
@@ -470,9 +462,8 @@ int storage_guild_storageadd(struct map_session_data* sd, int index, int amount)
if( amount < 1 || amount > sd->status.inventory[index].amount )
return 0;
-// log_tostorage(sd, index, 1);
if(guild_storage_additem(sd,stor,&sd->status.inventory[index],amount)==0)
- pc_delitem(sd,index,amount,0,4);
+ pc_delitem(sd,index,amount,0,4,LOG_TYPE_GSTORAGE);
return 1;
}
@@ -497,7 +488,7 @@ int storage_guild_storageget(struct map_session_data* sd, int index, int amount)
if(amount < 1 || amount > stor->items[index].amount)
return 0;
- if((flag = pc_additem(sd,&stor->items[index],amount)) == 0)
+ if((flag = pc_additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)) == 0)
guild_storage_delitem(sd,stor,index,amount);
else
clif_additem(sd,0,0,flag);
@@ -526,7 +517,7 @@ int storage_guild_storageaddfromcart(struct map_session_data* sd, int index, int
return 0;
if(guild_storage_additem(sd,stor,&sd->status.cart[index],amount)==0)
- pc_cart_delitem(sd,index,amount,0);
+ pc_cart_delitem(sd,index,amount,0,LOG_TYPE_GSTORAGE);
return 1;
}
@@ -550,7 +541,7 @@ int storage_guild_storagegettocart(struct map_session_data* sd, int index, int a
if(amount < 1 || amount > stor->items[index].amount)
return 0;
- if(pc_cart_additem(sd,&stor->items[index],amount)==0)
+ if(pc_cart_additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)==0)
guild_storage_delitem(sd,stor,index,amount);
return 1;