diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/char/int_storage.c | 28 | ||||
-rw-r--r-- | src/char_sql/int_storage.c | 4 | ||||
-rw-r--r-- | src/common/mmo.h | 2 | ||||
-rw-r--r-- | src/map/charcommand.c | 14 | ||||
-rw-r--r-- | src/map/clif.c | 32 | ||||
-rw-r--r-- | src/map/storage.c | 36 |
6 files changed, 58 insertions, 58 deletions
diff --git a/src/char/int_storage.c b/src/char/int_storage.c index 75d951190..bb539b411 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -35,12 +35,12 @@ int storage_tostr(char *str,struct storage_data *p) str_p += sprintf(str_p,"%d,%d\t",p->account_id,p->storage_amount); for(i=0;i<MAX_STORAGE;i++) - if( (p->storage_[i].nameid) && (p->storage_[i].amount) ){ + if( (p->items[i].nameid) && (p->items[i].amount) ){ str_p += sprintf(str_p,"%d,%d,%d,%d,%d,%d,%d", - p->storage_[i].id,p->storage_[i].nameid,p->storage_[i].amount,p->storage_[i].equip, - p->storage_[i].identify,p->storage_[i].refine,p->storage_[i].attribute); + p->items[i].id,p->items[i].nameid,p->items[i].amount,p->items[i].equip, + p->items[i].identify,p->items[i].refine,p->items[i].attribute); for(j=0; j<MAX_SLOTS; j++) - str_p += sprintf(str_p,",%d",p->storage_[i].card[j]); + str_p += sprintf(str_p,",%d",p->items[i].card[j]); str_p += sprintf(str_p," "); f++; } @@ -72,16 +72,16 @@ int storage_fromstr(char *str,struct storage_data *p) if(sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d%[0-9,-]%n", &tmp_int[0], &tmp_int[1], &tmp_int[2], &tmp_int[3], &tmp_int[4], &tmp_int[5], &tmp_int[6], tmp_str, &len) == 8) { - p->storage_[i].id = tmp_int[0]; - p->storage_[i].nameid = tmp_int[1]; - p->storage_[i].amount = tmp_int[2]; - p->storage_[i].equip = tmp_int[3]; - p->storage_[i].identify = tmp_int[4]; - p->storage_[i].refine = tmp_int[5]; - p->storage_[i].attribute = tmp_int[6]; + p->items[i].id = tmp_int[0]; + p->items[i].nameid = tmp_int[1]; + p->items[i].amount = tmp_int[2]; + p->items[i].equip = tmp_int[3]; + p->items[i].identify = tmp_int[4]; + p->items[i].refine = tmp_int[5]; + p->items[i].attribute = tmp_int[6]; for(j = 0; j < MAX_SLOTS && tmp_str && sscanf(tmp_str, ",%d%[0-9,-]",&tmp_int[0], tmp_str) > 0; j++) - p->storage_[i].card[j] = tmp_int[0]; + p->items[i].card[j] = tmp_int[0]; next += len; if (str[next] == ' ') @@ -323,8 +323,8 @@ int inter_storage_delete(int account_id) if(s) { int i; for(i=0;i<s->storage_amount;i++){ - if(s->storage_[i].card[0] == (short)0xff00) - inter_pet_delete( MakeDWord(s->storage_[i].card[1],s->storage_[i].card[2]) ); + if(s->items[i].card[0] == (short)0xff00) + inter_pet_delete( MakeDWord(s->items[i].card[1],s->items[i].card[2]) ); } idb_remove(storage_db,account_id); } diff --git a/src/char_sql/int_storage.c b/src/char_sql/int_storage.c index f680199a7..cce358d76 100644 --- a/src/char_sql/int_storage.c +++ b/src/char_sql/int_storage.c @@ -20,7 +20,7 @@ /// Save guild_storage data to sql int storage_tosql(int account_id, struct storage_data* p) { - memitemdata_to_sql(p->storage_, MAX_STORAGE, account_id, TABLE_STORAGE); + memitemdata_to_sql(p->items, MAX_STORAGE, account_id, TABLE_STORAGE); //ShowInfo ("storage save to DB - account: %d\n", account_id); return 0; } @@ -53,7 +53,7 @@ int storage_fromsql(int account_id, struct storage_data* p) for( i = 0; i < MAX_STORAGE && SQL_SUCCESS == Sql_NextRow(sql_handle); ++i ) { - item = &p->storage_[i]; + item = &p->items[i]; Sql_GetData(sql_handle, 0, &data, NULL); item->id = atoi(data); Sql_GetData(sql_handle, 1, &data, NULL); item->nameid = atoi(data); Sql_GetData(sql_handle, 2, &data, NULL); item->amount = atoi(data); diff --git a/src/common/mmo.h b/src/common/mmo.h index f9727a223..61cd6266c 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -334,7 +334,7 @@ struct storage_data { int account_id; short storage_status; short storage_amount; - struct item storage_[MAX_STORAGE]; + struct item items[MAX_STORAGE]; }; struct guild_storage { 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; |