diff options
author | Lupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-02-24 16:49:25 +0000 |
---|---|---|
committer | Lupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-02-24 16:49:25 +0000 |
commit | a06301e47be21176c4b553d7abb3ef5db7f72945 (patch) | |
tree | 8d19f0783f1d71a11c336cfe9e35a1e83eb10645 /src/map | |
parent | 4f8feb79e16e222a71d4fb3b057688ca8285d002 (diff) | |
download | hercules-a06301e47be21176c4b553d7abb3ef5db7f72945.tar.gz hercules-a06301e47be21176c4b553d7abb3ef5db7f72945.tar.bz2 hercules-a06301e47be21176c4b553d7abb3ef5db7f72945.tar.xz hercules-a06301e47be21176c4b553d7abb3ef5db7f72945.zip |
added cart dupe-proof for named / cards items
removed unusef check_cloak_type func
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1173 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/pc.c | 30 | ||||
-rw-r--r-- | src/map/skill.c | 19 | ||||
-rw-r--r-- | src/map/skill.h | 1 |
3 files changed, 12 insertions, 38 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index b7b80b525..484a25b18 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2235,9 +2235,11 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount) i = MAX_INVENTORY; if(!itemdb_isequip2(data)){ - // ? 備品ではないので、?所有品なら個?のみ?化させる + // 装 備品ではないので、既所有品なら個数のみ変化させる for(i=0;i<MAX_INVENTORY;i++) - if(compare_item(&sd->status.inventory[i], item_data)) { + 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(sd->status.inventory[i].amount+amount > MAX_AMOUNT) return 5; sd->status.inventory[i].amount+=amount; @@ -2246,16 +2248,11 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount) } } if(i >= MAX_INVENTORY){ - // ? 備品か未所有品だったので空き欄へ追加 + // 装 備品か未所有品だったので空き欄へ追加 i = pc_search_inventory(sd,0); if(i >= 0) { memcpy(&sd->status.inventory[i],item_data,sizeof(sd->status.inventory[0])); - if(itemdb_isequip2(data)){ - sd->status.inventory[i].amount=1; - amount=1; - } else { - sd->status.inventory[i].amount=amount; - } + sd->status.inventory[i].amount=amount; sd->inventory_data[i]=data; clif_additem(sd,i,amount,0); } @@ -2477,9 +2474,11 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun i=MAX_CART; if(!itemdb_isequip2(data)){ - // ? 備品ではないので、?所有品なら個?のみ?化させる + // 装 備品ではないので、既所有品なら個数のみ変化させる for(i=0;i<MAX_CART;i++){ - if(compare_item(&sd->status.cart[i], item_data)) { + 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(sd->status.cart[i].amount+amount > MAX_AMOUNT) return 1; sd->status.cart[i].amount+=amount; @@ -2489,16 +2488,11 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun } } if(i >= MAX_CART){ - // ? 備品か未所有品だったので空き欄へ追加 + // 装 備品か未所有品だったので空き欄へ追加 for(i=0;i<MAX_CART;i++){ if(sd->status.cart[i].nameid==0){ memcpy(&sd->status.cart[i],item_data,sizeof(sd->status.cart[0])); - if(itemdb_isequip2(data)){ - sd->status.inventory[i].amount=1; - amount=1; - } else { - sd->status.inventory[i].amount=amount; - } + sd->status.cart[i].amount=amount; sd->cart_num++; clif_cart_additem(sd,i,amount,0); break; diff --git a/src/map/skill.c b/src/map/skill.c index 0b118eb96..ee05cc2c4 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -8036,25 +8036,6 @@ int skill_check_cloaking(struct block_list *bl) return end; } -int skill_type_cloaking(struct block_list *bl) -{ - static int dx[]={ 0, 1, 0, -1, -1, 1, 1, -1}; //optimized by Lupus - static int dy[]={-1, 0, 1, 0, -1, -1, 1, 1}; - int i; - - nullpo_retr(0, bl); - if(bl->type == BL_PC && battle_config.pc_cloak_check_type&1) - return 0; - else if(bl->type == BL_MOB && battle_config.monster_cloak_check_type&1) - return 0; - for(i=0; i<sizeof(dx)/sizeof(dx[0]); i++) - { - if(map_getcell(bl->m,bl->x+dx[i],bl->y+dy[i],CELL_CHKNOPASS)) - return 0; - } - return 1; -} - /* *---------------------------------------------------------------------------- * スキルユニット diff --git a/src/map/skill.h b/src/map/skill.h index 2fb7b765a..c4b2f69cd 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -170,7 +170,6 @@ void skill_devotion_end(struct map_session_data *md,struct map_session_data *sd, // その他 int skill_check_cloaking(struct block_list *bl); -int skill_type_cloaking(struct block_list *bl); // ステ?タス異常 int skill_encchant_eremental_end(struct block_list *bl, int type); |