diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/charcommand.c | 14 | ||||
-rw-r--r-- | src/map/clif.c | 32 | ||||
-rw-r--r-- | src/map/storage.c | 36 |
3 files changed, 41 insertions, 41 deletions
diff --git a/src/map/charcommand.c b/src/map/charcommand.c index 50cdf5b60..4ba77200a 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -638,23 +638,23 @@ int charcommand_storagelist(const int fd, struct map_session_data* sd, const cha counter = 0; count = 0; for (i = 0; i < MAX_STORAGE; i++) { - if (stor->storage_[i].nameid > 0 && (item_data = itemdb_search(stor->storage_[i].nameid)) != NULL) { - counter = counter + stor->storage_[i].amount; + if (stor->items[i].nameid > 0 && (item_data = itemdb_search(stor->items[i].nameid)) != NULL) { + counter = counter + stor->items[i].amount; count++; if (count == 1) { sprintf(output, "------ Storage items list of '%s' ------", pl_sd->status.name); clif_displaymessage(fd, output); } - if (stor->storage_[i].refine) - sprintf(output, "%d %s %+d (%s %+d, id: %d)", stor->storage_[i].amount, item_data->name, stor->storage_[i].refine, item_data->jname, stor->storage_[i].refine, stor->storage_[i].nameid); + if (stor->items[i].refine) + sprintf(output, "%d %s %+d (%s %+d, id: %d)", stor->items[i].amount, item_data->name, stor->items[i].refine, item_data->jname, stor->items[i].refine, stor->items[i].nameid); else - sprintf(output, "%d %s (%s, id: %d)", stor->storage_[i].amount, item_data->name, item_data->jname, stor->storage_[i].nameid); + sprintf(output, "%d %s (%s, id: %d)", stor->items[i].amount, item_data->name, item_data->jname, stor->items[i].nameid); clif_displaymessage(fd, output); memset(output, '\0', sizeof(output)); counter2 = 0; for (j = 0; j < item_data->slot; j++) { - if (stor->storage_[i].card[j]) { - if ((item_temp = itemdb_search(stor->storage_[i].card[j])) != NULL) { + if (stor->items[i].card[j]) { + if ((item_temp = itemdb_search(stor->items[i].card[j])) != NULL) { if (output[0] == '\0') sprintf(outputtmp, " -> (card(s): #%d %s (%s), ", ++counter2, item_temp->name, item_temp->jname); else diff --git a/src/map/clif.c b/src/map/clif.c index 3033717c5..b4e309184 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1883,20 +1883,20 @@ void clif_storagelist(struct map_session_data *sd,struct storage_data *stor) buf = WFIFOP(fd,0); for(i=0,n=0,ne=0;i<MAX_STORAGE;i++){ - if(stor->storage_[i].nameid<=0) + if(stor->items[i].nameid<=0) continue; - id = itemdb_search(stor->storage_[i].nameid); + id = itemdb_search(stor->items[i].nameid); if(!itemdb_isstackable2(id)) { //Equippable WBUFW(bufe,ne*20+4)=i+1; - clif_item_sub(bufe, ne*20+6, &stor->storage_[i], id, id->equip); - clif_addcards(WBUFP(bufe, ne*20+16), &stor->storage_[i]); + clif_item_sub(bufe, ne*20+6, &stor->items[i], id, id->equip); + clif_addcards(WBUFP(bufe, ne*20+16), &stor->items[i]); ne++; } else { //Stackable WBUFW(buf,n*s+4)=i+1; - clif_item_sub(buf, n*s+6, &stor->storage_[i], id,-1); + clif_item_sub(buf, n*s+6, &stor->items[i], id,-1); #if PACKETVER >= 5 - clif_addcards(WBUFP(buf,n*s+14), &stor->storage_[i]); + clif_addcards(WBUFP(buf,n*s+14), &stor->items[i]); #endif n++; } @@ -3217,29 +3217,29 @@ int clif_storageitemadded(struct map_session_data *sd,struct storage_data *stor, WFIFOW(fd,0) =0xf4; // Storage item added WFIFOW(fd,2) =index+1; // index WFIFOL(fd,4) =amount; // amount - if((view = itemdb_viewid(stor->storage_[index].nameid)) > 0) + if((view = itemdb_viewid(stor->items[index].nameid)) > 0) WFIFOW(fd,8) =view; else - WFIFOW(fd,8) =stor->storage_[index].nameid; // id + WFIFOW(fd,8) =stor->items[index].nameid; // id WFIFOB(fd,10)=stor->storage_[index].identify; //identify flag WFIFOB(fd,11)=stor->storage_[index].attribute; // attribute WFIFOB(fd,12)=stor->storage_[index].refine; //refine - clif_addcards(WFIFOP(fd,13), &stor->storage_[index]); + clif_addcards(WFIFOP(fd,13), &stor->items[index]); WFIFOSET(fd,packet_len(0xf4)); #else WFIFOHEAD(fd,packet_len(0x1c4)); WFIFOW(fd,0) =0x1c4; // Storage item added WFIFOW(fd,2) =index+1; // index WFIFOL(fd,4) =amount; // amount - if((view = itemdb_viewid(stor->storage_[index].nameid)) > 0) + if((view = itemdb_viewid(stor->items[index].nameid)) > 0) WFIFOW(fd,8) =view; else - WFIFOW(fd,8) =stor->storage_[index].nameid; // id - WFIFOB(fd,10)=itemdb_type(stor->storage_[index].nameid); //type - WFIFOB(fd,11)=stor->storage_[index].identify; //identify flag - WFIFOB(fd,12)=stor->storage_[index].attribute; // attribute - WFIFOB(fd,13)=stor->storage_[index].refine; //refine - clif_addcards(WFIFOP(fd,14), &stor->storage_[index]); + WFIFOW(fd,8) =stor->items[index].nameid; // id + WFIFOB(fd,10)=itemdb_type(stor->items[index].nameid); //type + WFIFOB(fd,11)=stor->items[index].identify; //identify flag + WFIFOB(fd,12)=stor->items[index].attribute; // attribute + WFIFOB(fd,13)=stor->items[index].refine; //refine + clif_addcards(WFIFOP(fd,14), &stor->items[index]); WFIFOSET(fd,packet_len(0x1c4)); #endif diff --git a/src/map/storage.c b/src/map/storage.c index 541c28e4c..eb6ce0363 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -47,7 +47,7 @@ int storage_comp_item(const void *_i1, const void *_i2) void storage_sortitem (struct storage_data *stor) { nullpo_retv(stor); - qsort(stor->storage_, MAX_STORAGE, sizeof(struct item), storage_comp_item); + qsort(stor->items, MAX_STORAGE, sizeof(struct item), storage_comp_item); } void storage_gsortitem (struct guild_storage* gstor) @@ -193,10 +193,10 @@ static int storage_additem(struct map_session_data *sd,struct storage_data *stor if(itemdb_isstackable2(data)){ //Stackable for(i=0;i<MAX_STORAGE;i++){ - if( compare_item (&stor->storage_[i], item_data)) { - if(amount > MAX_AMOUNT - stor->storage_[i].amount) + if( compare_item (&stor->items[i], item_data)) { + if(amount > MAX_AMOUNT - stor->items[i].amount) return 1; - stor->storage_[i].amount+=amount; + stor->items[i].amount+=amount; clif_storageitemadded(sd,stor,i,amount); stor->dirty = 1; if(log_config.enable_logs&0x800) @@ -206,13 +206,13 @@ static int storage_additem(struct map_session_data *sd,struct storage_data *stor } } //Add item - for(i=0;i<MAX_STORAGE && stor->storage_[i].nameid;i++); + for(i=0;i<MAX_STORAGE && stor->items[i].nameid;i++); if(i>=MAX_STORAGE) return 1; - memcpy(&stor->storage_[i],item_data,sizeof(stor->storage_[0])); - stor->storage_[i].amount=amount; + memcpy(&stor->items[i],item_data,sizeof(stor->items[0])); + stor->items[i].amount=amount; stor->storage_amount++; clif_storageitemadded(sd,stor,i,amount); clif_updatestorageamount(sd,stor); @@ -227,14 +227,14 @@ static int storage_additem(struct map_session_data *sd,struct storage_data *stor static int storage_delitem(struct map_session_data *sd,struct storage_data *stor,int n,int amount) { - if(stor->storage_[n].nameid==0 || stor->storage_[n].amount<amount) + if(stor->items[n].nameid==0 || stor->items[n].amount<amount) return 1; - stor->storage_[n].amount-=amount; + stor->items[n].amount-=amount; if(log_config.enable_logs&0x800) - log_pick_pc(sd, "R", stor->storage_[n].nameid, amount, &stor->storage_[n]); - if(stor->storage_[n].amount==0){ - memset(&stor->storage_[n],0,sizeof(stor->storage_[0])); + log_pick_pc(sd, "R", 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--; clif_updatestorageamount(sd,stor); } @@ -288,13 +288,13 @@ int storage_storageget(struct map_session_data *sd,int index,int amount) if(index<0 || index>=MAX_STORAGE) return 0; - if(stor->storage_[index].nameid <= 0) + if(stor->items[index].nameid <= 0) return 0; //Nothing there - if(amount < 1 || amount > stor->storage_[index].amount) + if(amount < 1 || amount > stor->items[index].amount) return 0; - if((flag = pc_additem(sd,&stor->storage_[index],amount)) == 0) + if((flag = pc_additem(sd,&stor->items[index],amount)) == 0) storage_delitem(sd,stor,index,amount); else clif_additem(sd,0,0,flag); @@ -345,13 +345,13 @@ int storage_storagegettocart(struct map_session_data *sd,int index,int amount) if(index< 0 || index>=MAX_STORAGE) return 0; - if(stor->storage_[index].nameid <= 0) + if(stor->items[index].nameid <= 0) return 0; //Nothing there. - if(amount < 1 || amount > stor->storage_[index].amount) + if(amount < 1 || amount > stor->items[index].amount) return 0; - if(pc_cart_additem(sd,&stor->storage_[index],amount)==0) + if(pc_cart_additem(sd,&stor->items[index],amount)==0) storage_delitem(sd,stor,index,amount); return 1; |