summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-24 17:08:58 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-24 17:08:58 +0000
commitf762bfba6e4e3e29db6898f1c61023f662330270 (patch)
treee0809191f340d0c1f4ce5315a3d19b6540d03e64
parentd8b857ad9db40f4e6345419c8d3659b7914519e7 (diff)
downloadhercules-f762bfba6e4e3e29db6898f1c61023f662330270.tar.gz
hercules-f762bfba6e4e3e29db6898f1c61023f662330270.tar.bz2
hercules-f762bfba6e4e3e29db6898f1c61023f662330270.tar.xz
hercules-f762bfba6e4e3e29db6898f1c61023f662330270.zip
update
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@779 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt1
-rw-r--r--Dev/bugs.txt11
-rw-r--r--src/map/map.c12
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/storage.c11
6 files changed, 22 insertions, 22 deletions
diff --git a/Changelog.txt b/Changelog.txt
index e3a203d4c..f31222fe3 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,6 @@
Date Added
12/24
+ * Fixed item-dup bug in storage and cart [MouseJstr]
* @skilltree was looking outside of the particular class
of the char to see if they could do a skill [MouseJstr]
* Fixed a calc_skill_tree bug where too many skills were
diff --git a/Dev/bugs.txt b/Dev/bugs.txt
index ec45649b5..36409cbe4 100644
--- a/Dev/bugs.txt
+++ b/Dev/bugs.txt
@@ -55,17 +55,14 @@ Assigned: N/A
Progress: 0%
Problem: Item duping bug in storage...
-Assigned: N/A
-Progress: 0%
+Assigned: MouseJstr
+Progress: 100%
Let's say you have 200 arrows and 100 Rosiotti arrow, you'll put 100 and 50 in storage
And you should end when you log back in with 100 of each on you and 100 and 50 in storage
Gain 50
Repeat
- Lupus: heh i fixid similiar bug in DELITEM script command. i think it's the same bug in other function
- so i'm in charge
-
Problem: ~40+ players connected.. and soon can't re-connect, they can enter password, but never see "select character" screen.
Assigned: N/A
Progress: 0%
@@ -150,5 +147,5 @@ Progress: 0%
Problem: When you have UNNAMED Arrows and Named Arrows in the storage and take some arrows then it change amount of other items.
It happens because server doesn't recognize Named and Unnamed Stockable items (Elemental Gems, Iron, Steel, Holy Water, Arrows)
-Assigned: N/A
-Progress: 0%
+Assigned: MouseJstr
+Progress: 100%
diff --git a/src/map/map.c b/src/map/map.c
index 0150926d7..55718a37d 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2476,3 +2476,15 @@ int do_init(int argc, char *argv[]) {
return 0;
}
+
+int compare_item(struct item *a, struct item *b) {
+ return (
+ (a->nameid == b->nameid) &&
+ (a->identify == b->identify) &&
+ (a->refine == b->refine) &&
+ (a->attribute == b->attribute) &&
+ (a->card[0] == b->card[0]) &&
+ (a->card[1] == b->card[1]) &&
+ (a->card[2] == b->card[2]) &&
+ (a->card[3] == b->card[3]));
+}
diff --git a/src/map/map.h b/src/map/map.h
index 1c9565341..9d8a0b194 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -695,6 +695,7 @@ void map_deliddb(struct block_list *bl);
int map_foreachiddb(int (*)(void*,void*,va_list),...);
void map_addnickdb(struct map_session_data *);
struct map_session_data * map_nick2sd(char*);
+int compare_item(struct item *a, struct item *b);
// gat関連
int map_getcell(int,int,int);
diff --git a/src/map/pc.c b/src/map/pc.c
index 896a905fb..897b96861 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3213,9 +3213,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount)
if(!itemdb_isequip2(data)){
// ? 備品ではないので、?所有品なら個?のみ?化させる
for(i=0;i<MAX_INVENTORY;i++)
- if(sd->status.inventory[i].nameid == item_data->nameid &&
- sd->status.inventory[i].card[0] == item_data->card[0] && sd->status.inventory[i].card[1] == item_data->card[1] &&
- sd->status.inventory[i].card[2] == item_data->card[2] && sd->status.inventory[i].card[3] == item_data->card[3]) {
+ if(compare_item(&sd->status.inventory[i], item_data)) {
if(sd->status.inventory[i].amount+amount > MAX_AMOUNT)
return 5;
sd->status.inventory[i].amount+=amount;
@@ -3450,9 +3448,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
if(!itemdb_isequip2(data)){
// ? 備品ではないので、?所有品なら個?のみ?化させる
for(i=0;i<MAX_CART;i++){
- if(sd->status.cart[i].nameid==item_data->nameid &&
- sd->status.cart[i].card[0] == item_data->card[0] && sd->status.cart[i].card[1] == item_data->card[1] &&
- sd->status.cart[i].card[2] == item_data->card[2] && sd->status.cart[i].card[3] == item_data->card[3]){
+ if(compare_item(&sd->status.cart[i], item_data)) {
if(sd->status.cart[i].amount+amount > MAX_AMOUNT)
return 1;
sd->status.cart[i].amount+=amount;
diff --git a/src/map/storage.c b/src/map/storage.c
index eb9da1539..bc97b1390 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -144,12 +144,7 @@ int storage_additem(struct map_session_data *sd,struct storage *stor,struct item
if(!itemdb_isequip2(data)){
// 装備品ではないので、既所有品なら個数のみ変化させる
for(i=0;i<MAX_STORAGE;i++){
- if( stor->storage[i].nameid == item_data->nameid &&
- stor->storage[i].identify == item_data->identify &&
- stor->storage[i].refine == item_data->refine &&
- stor->storage[i].attribute == item_data->attribute &&
- stor->storage[i].card[0] == item_data->card[0] && stor->storage[i].card[1] == item_data->card[1] &&
- stor->storage[i].card[2] == item_data->card[2] && stor->storage[i].card[3] == item_data->card[3]){
+ if( compare_item (&stor->storage[i], item_data)) {
if(stor->storage[i].amount+amount > MAX_AMOUNT)
return 1;
stor->storage[i].amount+=amount;
@@ -434,9 +429,7 @@ int guild_storage_additem(struct map_session_data *sd,struct guild_storage *stor
if(!itemdb_isequip2(data)){
// 装備品ではないので、既所有品なら個数のみ変化させる
for(i=0;i<MAX_GUILD_STORAGE;i++){
- if(stor->storage[i].nameid == item_data->nameid &&
- stor->storage[i].card[0] == item_data->card[0] && stor->storage[i].card[1] == item_data->card[1] &&
- stor->storage[i].card[2] == item_data->card[2] && stor->storage[i].card[3] == item_data->card[3]){
+ if(compare_item(&stor->storage[i], item_data)) {
if(stor->storage[i].amount+amount > MAX_AMOUNT)
return 1;
stor->storage[i].amount+=amount;