diff options
author | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-29 05:05:50 +0000 |
---|---|---|
committer | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-29 05:05:50 +0000 |
commit | 7bfe35400c79bf97a5b0bed9f170912c37cf9452 (patch) | |
tree | 5651eae9e5b8e67d4f5476445d5faccb99c72248 /src/map | |
parent | 1038bc42b33b73eca592b22f2868844b6e64e842 (diff) | |
download | hercules-7bfe35400c79bf97a5b0bed9f170912c37cf9452.tar.gz hercules-7bfe35400c79bf97a5b0bed9f170912c37cf9452.tar.bz2 hercules-7bfe35400c79bf97a5b0bed9f170912c37cf9452.tar.xz hercules-7bfe35400c79bf97a5b0bed9f170912c37cf9452.zip |
Fixed use of storage variable to conform to ANSI C spec [MouseJstr]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1327 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/charcommand.c | 14 | ||||
-rw-r--r-- | src/map/clif.c | 208 | ||||
-rw-r--r-- | src/map/storage.c | 60 |
3 files changed, 141 insertions, 141 deletions
diff --git a/src/map/charcommand.c b/src/map/charcommand.c index ab57a6b39..15c94e51a 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -944,23 +944,23 @@ charcommand_storagelist( 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->storage_[i].nameid > 0 && (item_data = itemdb_search(stor->storage_[i].nameid)) != NULL) { + counter = counter + stor->storage_[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->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); 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->storage_[i].amount, item_data->name, item_data->jname, stor->storage_[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->storage_[i].card[j]) { + if ((item_temp = itemdb_search(stor->storage_[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 03622cfe3..9e649df40 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2084,9 +2084,9 @@ int clif_storageitemlist(struct map_session_data *sd,struct storage *stor) #if PACKETVER < 5 WBUFW(buf,0)=0xa5; for(i=0,n=0;i<MAX_STORAGE;i++){ - if(stor->storage[i].nameid<=0) + if(stor->storage_[i].nameid<=0) continue; - nullpo_retr(0, id = itemdb_search(stor->storage[i].nameid)); + nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid)); if(itemdb_isequip2(id)) continue; @@ -2094,10 +2094,10 @@ int clif_storageitemlist(struct map_session_data *sd,struct storage *stor) if(id->view_id > 0) WBUFW(buf,n*10+6)=id->view_id; else - WBUFW(buf,n*10+6)=stor->storage[i].nameid; + WBUFW(buf,n*10+6)=stor->storage_[i].nameid; WBUFB(buf,n*10+8)=id->type;; - WBUFB(buf,n*10+9)=stor->storage[i].identify; - WBUFW(buf,n*10+10)=stor->storage[i].amount; + WBUFB(buf,n*10+9)=stor->storage_[i].identify; + WBUFW(buf,n*10+10)=stor->storage_[i].amount; WBUFW(buf,n*10+12)=0; n++; } @@ -2108,9 +2108,9 @@ int clif_storageitemlist(struct map_session_data *sd,struct storage *stor) #else WBUFW(buf,0)=0x1f0; for(i=0,n=0;i<MAX_STORAGE;i++){ - if(stor->storage[i].nameid<=0) + if(stor->storage_[i].nameid<=0) continue; - nullpo_retr(0, id = itemdb_search(stor->storage[i].nameid)); + nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid)); if(itemdb_isequip2(id)) continue; @@ -2118,15 +2118,15 @@ int clif_storageitemlist(struct map_session_data *sd,struct storage *stor) if(id->view_id > 0) WBUFW(buf,n*18+6)=id->view_id; else - WBUFW(buf,n*18+6)=stor->storage[i].nameid; + WBUFW(buf,n*18+6)=stor->storage_[i].nameid; WBUFB(buf,n*18+8)=id->type;; - WBUFB(buf,n*18+9)=stor->storage[i].identify; - WBUFW(buf,n*18+10)=stor->storage[i].amount; + WBUFB(buf,n*18+9)=stor->storage_[i].identify; + WBUFW(buf,n*18+10)=stor->storage_[i].amount; WBUFW(buf,n*18+12)=0; - WBUFW(buf,n*18+14)=stor->storage[i].card[0]; - WBUFW(buf,n*18+16)=stor->storage[i].card[1]; - WBUFW(buf,n*18+18)=stor->storage[i].card[2]; - WBUFW(buf,n*18+20)=stor->storage[i].card[3]; + WBUFW(buf,n*18+14)=stor->storage_[i].card[0]; + WBUFW(buf,n*18+16)=stor->storage_[i].card[1]; + WBUFW(buf,n*18+18)=stor->storage_[i].card[2]; + WBUFW(buf,n*18+20)=stor->storage_[i].card[3]; n++; } if(n){ @@ -2154,44 +2154,44 @@ int clif_storageequiplist(struct map_session_data *sd,struct storage *stor) buf = WFIFOP(fd,0); WBUFW(buf,0)=0xa6; for(i=0,n=0;i<MAX_STORAGE;i++){ - if(stor->storage[i].nameid<=0) + if(stor->storage_[i].nameid<=0) continue; - nullpo_retr(0, id = itemdb_search(stor->storage[i].nameid)); + nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid)); if(!itemdb_isequip2(id)) continue; WBUFW(buf,n*20+4)=i+1; if(id->view_id > 0) WBUFW(buf,n*20+6)=id->view_id; else - WBUFW(buf,n*20+6)=stor->storage[i].nameid; + WBUFW(buf,n*20+6)=stor->storage_[i].nameid; WBUFB(buf,n*20+8)=id->type; - WBUFB(buf,n*20+9)=stor->storage[i].identify; + WBUFB(buf,n*20+9)=stor->storage_[i].identify; WBUFW(buf,n*20+10)=id->equip; - WBUFW(buf,n*20+12)=stor->storage[i].equip; - WBUFB(buf,n*20+14)=stor->storage[i].attribute; - WBUFB(buf,n*20+15)=stor->storage[i].refine; - if(stor->storage[i].card[0]==0x00ff || stor->storage[i].card[0]==0x00fe || stor->storage[i].card[0]==(short)0xff00) { - WBUFW(buf,n*20+16)=stor->storage[i].card[0]; - WBUFW(buf,n*20+18)=stor->storage[i].card[1]; - WBUFW(buf,n*20+20)=stor->storage[i].card[2]; - WBUFW(buf,n*20+22)=stor->storage[i].card[3]; + WBUFW(buf,n*20+12)=stor->storage_[i].equip; + WBUFB(buf,n*20+14)=stor->storage_[i].attribute; + WBUFB(buf,n*20+15)=stor->storage_[i].refine; + if(stor->storage_[i].card[0]==0x00ff || stor->storage_[i].card[0]==0x00fe || stor->storage_[i].card[0]==(short)0xff00) { + WBUFW(buf,n*20+16)=stor->storage_[i].card[0]; + WBUFW(buf,n*20+18)=stor->storage_[i].card[1]; + WBUFW(buf,n*20+20)=stor->storage_[i].card[2]; + WBUFW(buf,n*20+22)=stor->storage_[i].card[3]; } else { - if(stor->storage[i].card[0] > 0 && (j=itemdb_viewid(stor->storage[i].card[0])) > 0) + if(stor->storage_[i].card[0] > 0 && (j=itemdb_viewid(stor->storage_[i].card[0])) > 0) WBUFW(buf,n*20+16)=j; else - WBUFW(buf,n*20+16)=stor->storage[i].card[0]; - if(stor->storage[i].card[1] > 0 && (j=itemdb_viewid(stor->storage[i].card[1])) > 0) + WBUFW(buf,n*20+16)=stor->storage_[i].card[0]; + if(stor->storage_[i].card[1] > 0 && (j=itemdb_viewid(stor->storage_[i].card[1])) > 0) WBUFW(buf,n*20+18)=j; else - WBUFW(buf,n*20+18)=stor->storage[i].card[1]; - if(stor->storage[i].card[2] > 0 && (j=itemdb_viewid(stor->storage[i].card[2])) > 0) + WBUFW(buf,n*20+18)=stor->storage_[i].card[1]; + if(stor->storage_[i].card[2] > 0 && (j=itemdb_viewid(stor->storage_[i].card[2])) > 0) WBUFW(buf,n*20+20)=j; else - WBUFW(buf,n*20+20)=stor->storage[i].card[2]; - if(stor->storage[i].card[3] > 0 && (j=itemdb_viewid(stor->storage[i].card[3])) > 0) + WBUFW(buf,n*20+20)=stor->storage_[i].card[2]; + if(stor->storage_[i].card[3] > 0 && (j=itemdb_viewid(stor->storage_[i].card[3])) > 0) WBUFW(buf,n*20+22)=j; else - WBUFW(buf,n*20+22)=stor->storage[i].card[3]; + WBUFW(buf,n*20+22)=stor->storage_[i].card[3]; } n++; } @@ -2221,9 +2221,9 @@ int clif_guildstorageitemlist(struct map_session_data *sd,struct guild_storage * #if PACKETVER < 5 WBUFW(buf,0)=0xa5; for(i=0,n=0;i<MAX_GUILD_STORAGE;i++){ - if(stor->storage[i].nameid<=0) + if(stor->storage_[i].nameid<=0) continue; - nullpo_retr(0, id = itemdb_search(stor->storage[i].nameid)); + nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid)); if(itemdb_isequip2(id)) continue; @@ -2231,10 +2231,10 @@ int clif_guildstorageitemlist(struct map_session_data *sd,struct guild_storage * if(id->view_id > 0) WBUFW(buf,n*10+6)=id->view_id; else - WBUFW(buf,n*10+6)=stor->storage[i].nameid; + WBUFW(buf,n*10+6)=stor->storage_[i].nameid; WBUFB(buf,n*10+8)=id->type;; - WBUFB(buf,n*10+9)=stor->storage[i].identify; - WBUFW(buf,n*10+10)=stor->storage[i].amount; + WBUFB(buf,n*10+9)=stor->storage_[i].identify; + WBUFW(buf,n*10+10)=stor->storage_[i].amount; WBUFW(buf,n*10+12)=0; n++; } @@ -2245,9 +2245,9 @@ int clif_guildstorageitemlist(struct map_session_data *sd,struct guild_storage * #else WBUFW(buf,0)=0x1f0; for(i=0,n=0;i<MAX_GUILD_STORAGE;i++){ - if(stor->storage[i].nameid<=0) + if(stor->storage_[i].nameid<=0) continue; - nullpo_retr(0, id = itemdb_search(stor->storage[i].nameid)); + nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid)); if(itemdb_isequip2(id)) continue; @@ -2255,15 +2255,15 @@ int clif_guildstorageitemlist(struct map_session_data *sd,struct guild_storage * if(id->view_id > 0) WBUFW(buf,n*18+6)=id->view_id; else - WBUFW(buf,n*18+6)=stor->storage[i].nameid; + WBUFW(buf,n*18+6)=stor->storage_[i].nameid; WBUFB(buf,n*18+8)=id->type;; - WBUFB(buf,n*18+9)=stor->storage[i].identify; - WBUFW(buf,n*18+10)=stor->storage[i].amount; + WBUFB(buf,n*18+9)=stor->storage_[i].identify; + WBUFW(buf,n*18+10)=stor->storage_[i].amount; WBUFW(buf,n*18+12)=0; - WBUFW(buf,n*18+14)=stor->storage[i].card[0]; - WBUFW(buf,n*18+16)=stor->storage[i].card[1]; - WBUFW(buf,n*18+18)=stor->storage[i].card[2]; - WBUFW(buf,n*18+20)=stor->storage[i].card[3]; + WBUFW(buf,n*18+14)=stor->storage_[i].card[0]; + WBUFW(buf,n*18+16)=stor->storage_[i].card[1]; + WBUFW(buf,n*18+18)=stor->storage_[i].card[2]; + WBUFW(buf,n*18+20)=stor->storage_[i].card[3]; n++; } if(n){ @@ -2291,44 +2291,44 @@ int clif_guildstorageequiplist(struct map_session_data *sd,struct guild_storage WBUFW(buf,0)=0xa6; for(i=0,n=0;i<MAX_GUILD_STORAGE;i++){ - if(stor->storage[i].nameid<=0) + if(stor->storage_[i].nameid<=0) continue; - nullpo_retr(0, id = itemdb_search(stor->storage[i].nameid)); + nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid)); if(!itemdb_isequip2(id)) continue; WBUFW(buf,n*20+4)=i+1; if(id->view_id > 0) WBUFW(buf,n*20+6)=id->view_id; else - WBUFW(buf,n*20+6)=stor->storage[i].nameid; + WBUFW(buf,n*20+6)=stor->storage_[i].nameid; WBUFB(buf,n*20+8)=id->type; - WBUFB(buf,n*20+9)=stor->storage[i].identify; + WBUFB(buf,n*20+9)=stor->storage_[i].identify; WBUFW(buf,n*20+10)=id->equip; - WBUFW(buf,n*20+12)=stor->storage[i].equip; - WBUFB(buf,n*20+14)=stor->storage[i].attribute; - WBUFB(buf,n*20+15)=stor->storage[i].refine; - if(stor->storage[i].card[0]==0x00ff || stor->storage[i].card[0]==0x00fe || stor->storage[i].card[0]==(short)0xff00) { - WBUFW(buf,n*20+16)=stor->storage[i].card[0]; - WBUFW(buf,n*20+18)=stor->storage[i].card[1]; - WBUFW(buf,n*20+20)=stor->storage[i].card[2]; - WBUFW(buf,n*20+22)=stor->storage[i].card[3]; + WBUFW(buf,n*20+12)=stor->storage_[i].equip; + WBUFB(buf,n*20+14)=stor->storage_[i].attribute; + WBUFB(buf,n*20+15)=stor->storage_[i].refine; + if(stor->storage_[i].card[0]==0x00ff || stor->storage_[i].card[0]==0x00fe || stor->storage_[i].card[0]==(short)0xff00) { + WBUFW(buf,n*20+16)=stor->storage_[i].card[0]; + WBUFW(buf,n*20+18)=stor->storage_[i].card[1]; + WBUFW(buf,n*20+20)=stor->storage_[i].card[2]; + WBUFW(buf,n*20+22)=stor->storage_[i].card[3]; } else { - if(stor->storage[i].card[0] > 0 && (j=itemdb_viewid(stor->storage[i].card[0])) > 0) + if(stor->storage_[i].card[0] > 0 && (j=itemdb_viewid(stor->storage_[i].card[0])) > 0) WBUFW(buf,n*20+16)=j; else - WBUFW(buf,n*20+16)=stor->storage[i].card[0]; - if(stor->storage[i].card[1] > 0 && (j=itemdb_viewid(stor->storage[i].card[1])) > 0) + WBUFW(buf,n*20+16)=stor->storage_[i].card[0]; + if(stor->storage_[i].card[1] > 0 && (j=itemdb_viewid(stor->storage_[i].card[1])) > 0) WBUFW(buf,n*20+18)=j; else - WBUFW(buf,n*20+18)=stor->storage[i].card[1]; - if(stor->storage[i].card[2] > 0 && (j=itemdb_viewid(stor->storage[i].card[2])) > 0) + WBUFW(buf,n*20+18)=stor->storage_[i].card[1]; + if(stor->storage_[i].card[2] > 0 && (j=itemdb_viewid(stor->storage_[i].card[2])) > 0) WBUFW(buf,n*20+20)=j; else - WBUFW(buf,n*20+20)=stor->storage[i].card[2]; - if(stor->storage[i].card[3] > 0 && (j=itemdb_viewid(stor->storage[i].card[3])) > 0) + WBUFW(buf,n*20+20)=stor->storage_[i].card[2]; + if(stor->storage_[i].card[3] > 0 && (j=itemdb_viewid(stor->storage_[i].card[3])) > 0) WBUFW(buf,n*20+22)=j; else - WBUFW(buf,n*20+22)=stor->storage[i].card[3]; + WBUFW(buf,n*20+22)=stor->storage_[i].card[3]; } n++; } @@ -3372,35 +3372,35 @@ int clif_storageitemadded(struct map_session_data *sd,struct storage *stor,int i 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->storage_[index].nameid)) > 0) WFIFOW(fd,8) =view; else - WFIFOW(fd,8) =stor->storage[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 - if(stor->storage[index].card[0]==0x00ff || stor->storage[index].card[0]==0x00fe || stor->storage[index].card[0]==(short)0xff00) { - WFIFOW(fd,13)=stor->storage[index].card[0]; //card (4w) - WFIFOW(fd,15)=stor->storage[index].card[1]; //card (4w) - WFIFOW(fd,17)=stor->storage[index].card[2]; //card (4w) - WFIFOW(fd,19)=stor->storage[index].card[3]; //card (4w) + WFIFOW(fd,8) =stor->storage_[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 + if(stor->storage_[index].card[0]==0x00ff || stor->storage_[index].card[0]==0x00fe || stor->storage_[index].card[0]==(short)0xff00) { + WFIFOW(fd,13)=stor->storage_[index].card[0]; //card (4w) + WFIFOW(fd,15)=stor->storage_[index].card[1]; //card (4w) + WFIFOW(fd,17)=stor->storage_[index].card[2]; //card (4w) + WFIFOW(fd,19)=stor->storage_[index].card[3]; //card (4w) } else { - if(stor->storage[index].card[0] > 0 && (j=itemdb_viewid(stor->storage[index].card[0])) > 0) + if(stor->storage_[index].card[0] > 0 && (j=itemdb_viewid(stor->storage_[index].card[0])) > 0) WFIFOW(fd,13)= j; else - WFIFOW(fd,13)= stor->storage[index].card[0]; - if(stor->storage[index].card[1] > 0 && (j=itemdb_viewid(stor->storage[index].card[1])) > 0) + WFIFOW(fd,13)= stor->storage_[index].card[0]; + if(stor->storage_[index].card[1] > 0 && (j=itemdb_viewid(stor->storage_[index].card[1])) > 0) WFIFOW(fd,15)= j; else - WFIFOW(fd,15)= stor->storage[index].card[1]; - if(stor->storage[index].card[2] > 0 && (j=itemdb_viewid(stor->storage[index].card[2])) > 0) + WFIFOW(fd,15)= stor->storage_[index].card[1]; + if(stor->storage_[index].card[2] > 0 && (j=itemdb_viewid(stor->storage_[index].card[2])) > 0) WFIFOW(fd,17)= j; else - WFIFOW(fd,17)= stor->storage[index].card[2]; - if(stor->storage[index].card[3] > 0 && (j=itemdb_viewid(stor->storage[index].card[3])) > 0) + WFIFOW(fd,17)= stor->storage_[index].card[2]; + if(stor->storage_[index].card[3] > 0 && (j=itemdb_viewid(stor->storage_[index].card[3])) > 0) WFIFOW(fd,19)= j; else - WFIFOW(fd,19)= stor->storage[index].card[3]; + WFIFOW(fd,19)= stor->storage_[index].card[3]; } WFIFOSET(fd,packet_len_table[0xf4]); @@ -3442,35 +3442,35 @@ int clif_guildstorageitemadded(struct map_session_data *sd,struct guild_storage 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->storage_[index].nameid)) > 0) WFIFOW(fd,8) =view; else - WFIFOW(fd,8) =stor->storage[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 - if(stor->storage[index].card[0]==0x00ff || stor->storage[index].card[0]==0x00fe || stor->storage[index].card[0]==(short)0xff00) { - WFIFOW(fd,13)=stor->storage[index].card[0]; //card (4w) - WFIFOW(fd,15)=stor->storage[index].card[1]; //card (4w) - WFIFOW(fd,17)=stor->storage[index].card[2]; //card (4w) - WFIFOW(fd,19)=stor->storage[index].card[3]; //card (4w) + WFIFOW(fd,8) =stor->storage_[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 + if(stor->storage_[index].card[0]==0x00ff || stor->storage_[index].card[0]==0x00fe || stor->storage_[index].card[0]==(short)0xff00) { + WFIFOW(fd,13)=stor->storage_[index].card[0]; //card (4w) + WFIFOW(fd,15)=stor->storage_[index].card[1]; //card (4w) + WFIFOW(fd,17)=stor->storage_[index].card[2]; //card (4w) + WFIFOW(fd,19)=stor->storage_[index].card[3]; //card (4w) } else { - if(stor->storage[index].card[0] > 0 && (j=itemdb_viewid(stor->storage[index].card[0])) > 0) + if(stor->storage_[index].card[0] > 0 && (j=itemdb_viewid(stor->storage_[index].card[0])) > 0) WFIFOW(fd,13)= j; else - WFIFOW(fd,13)= stor->storage[index].card[0]; - if(stor->storage[index].card[1] > 0 && (j=itemdb_viewid(stor->storage[index].card[1])) > 0) + WFIFOW(fd,13)= stor->storage_[index].card[0]; + if(stor->storage_[index].card[1] > 0 && (j=itemdb_viewid(stor->storage_[index].card[1])) > 0) WFIFOW(fd,15)= j; else - WFIFOW(fd,15)= stor->storage[index].card[1]; - if(stor->storage[index].card[2] > 0 && (j=itemdb_viewid(stor->storage[index].card[2])) > 0) + WFIFOW(fd,15)= stor->storage_[index].card[1]; + if(stor->storage_[index].card[2] > 0 && (j=itemdb_viewid(stor->storage_[index].card[2])) > 0) WFIFOW(fd,17)= j; else - WFIFOW(fd,17)= stor->storage[index].card[2]; - if(stor->storage[index].card[3] > 0 && (j=itemdb_viewid(stor->storage[index].card[3])) > 0) + WFIFOW(fd,17)= stor->storage_[index].card[2]; + if(stor->storage_[index].card[3] > 0 && (j=itemdb_viewid(stor->storage_[index].card[3])) > 0) WFIFOW(fd,19)= j; else - WFIFOW(fd,19)= stor->storage[index].card[3]; + WFIFOW(fd,19)= stor->storage_[index].card[3]; } WFIFOSET(fd,packet_len_table[0xf4]); diff --git a/src/map/storage.c b/src/map/storage.c index 5e3797740..c9f4ffd62 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -46,13 +46,13 @@ struct item *i2=(struct item *)_i2; void sortage_sortitem(struct storage* stor){ nullpo_retv(stor); - qsort(stor->storage, MAX_STORAGE, sizeof(struct item), storage_comp_item); + qsort(stor->storage_, MAX_STORAGE, sizeof(struct item), storage_comp_item); } void sortage_gsortitem(struct guild_storage* gstor){ nullpo_retv(gstor); - qsort(gstor->storage, MAX_GUILD_STORAGE, sizeof(struct item), storage_comp_item); + qsort(gstor->storage_, MAX_GUILD_STORAGE, sizeof(struct item), storage_comp_item); } /*========================================== @@ -169,10 +169,10 @@ 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( compare_item (&stor->storage[i], item_data)) { - if(stor->storage[i].amount+amount > MAX_AMOUNT) + if( compare_item (&stor->storage_[i], item_data)) { + if(stor->storage_[i].amount+amount > MAX_AMOUNT) return 1; - stor->storage[i].amount+=amount; + stor->storage_[i].amount+=amount; clif_storageitemadded(sd,stor,i,amount); break; } @@ -181,9 +181,9 @@ int storage_additem(struct map_session_data *sd,struct storage *stor,struct item if(i>=MAX_STORAGE){ // 装備品か未所有品だったので空き欄へ追加 for(i=0;i<MAX_STORAGE;i++){ - if(stor->storage[i].nameid==0){ - memcpy(&stor->storage[i],item_data,sizeof(stor->storage[0])); - stor->storage[i].amount=amount; + if(stor->storage_[i].nameid==0){ + memcpy(&stor->storage_[i],item_data,sizeof(stor->storage_[0])); + stor->storage_[i].amount=amount; stor->storage_amount++; clif_storageitemadded(sd,stor,i,amount); clif_updatestorageamount(sd,stor); @@ -205,12 +205,12 @@ int storage_delitem(struct map_session_data *sd,struct storage *stor,int n,int a nullpo_retr(1, sd); nullpo_retr(1, stor); - if(stor->storage[n].nameid==0 || stor->storage[n].amount<amount) + if(stor->storage_[n].nameid==0 || stor->storage_[n].amount<amount) return 1; - stor->storage[n].amount-=amount; - if(stor->storage[n].amount==0){ - memset(&stor->storage[n],0,sizeof(stor->storage[0])); + stor->storage_[n].amount-=amount; + if(stor->storage_[n].amount==0){ + memset(&stor->storage_[n],0,sizeof(stor->storage_[0])); stor->storage_amount--; clif_updatestorageamount(sd,stor); } @@ -258,8 +258,8 @@ int storage_storageget(struct map_session_data *sd,int index,int amount) if(stor->storage_status == 1) { // storage open if(index>=0 && index<MAX_STORAGE) { // valid index - if( (amount <= stor->storage[index].amount) && (amount > 0) ) { //valid amount - if((flag = pc_additem(sd,&stor->storage[index],amount)) == 0) + if( (amount <= stor->storage_[index].amount) && (amount > 0) ) { //valid amount + if((flag = pc_additem(sd,&stor->storage_[index],amount)) == 0) storage_delitem(sd,stor,index,amount); else clif_additem(sd,0,0,flag); @@ -305,8 +305,8 @@ int storage_storagegettocart(struct map_session_data *sd,int index,int amount) if(stor->storage_status == 1) { // storage open if(index>=0 && index<MAX_STORAGE) { // valid index - if( (amount <= stor->storage[index].amount) && (amount > 0) ) { //valid amount - if(pc_cart_additem(sd,&stor->storage[index],amount)==0){ + if( (amount <= stor->storage_[index].amount) && (amount > 0) ) { //valid amount + if(pc_cart_additem(sd,&stor->storage_[index],amount)==0){ storage_delitem(sd,stor,index,amount); } } // valid amount @@ -454,10 +454,10 @@ 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(compare_item(&stor->storage[i], item_data)) { - if(stor->storage[i].amount+amount > MAX_AMOUNT) + if(compare_item(&stor->storage_[i], item_data)) { + if(stor->storage_[i].amount+amount > MAX_AMOUNT) return 1; - stor->storage[i].amount+=amount; + stor->storage_[i].amount+=amount; clif_guildstorageitemadded(sd,stor,i,amount); break; } @@ -466,9 +466,9 @@ int guild_storage_additem(struct map_session_data *sd,struct guild_storage *stor if(i>=MAX_GUILD_STORAGE){ // 装備品か未所有品だったので空き欄へ追加 for(i=0;i<MAX_GUILD_STORAGE;i++){ - if(stor->storage[i].nameid==0){ - memcpy(&stor->storage[i],item_data,sizeof(stor->storage[0])); - stor->storage[i].amount=amount; + if(stor->storage_[i].nameid==0){ + memcpy(&stor->storage_[i],item_data,sizeof(stor->storage_[0])); + stor->storage_[i].amount=amount; stor->storage_amount++; clif_guildstorageitemadded(sd,stor,i,amount); clif_updateguildstorageamount(sd,stor); @@ -486,12 +486,12 @@ int guild_storage_delitem(struct map_session_data *sd,struct guild_storage *stor nullpo_retr(1, sd); nullpo_retr(1, stor); - if(stor->storage[n].nameid==0 || stor->storage[n].amount<amount) + if(stor->storage_[n].nameid==0 || stor->storage_[n].amount<amount) return 1; - stor->storage[n].amount-=amount; - if(stor->storage[n].amount==0){ - memset(&stor->storage[n],0,sizeof(stor->storage[0])); + stor->storage_[n].amount-=amount; + if(stor->storage_[n].amount==0){ + memset(&stor->storage_[n],0,sizeof(stor->storage_[0])); stor->storage_amount--; clif_updateguildstorageamount(sd,stor); } @@ -531,8 +531,8 @@ int storage_guild_storageget(struct map_session_data *sd,int index,int amount) if((stor=guild2storage(sd->status.guild_id)) != NULL) { if(stor->storage_status == 1) { // storage open if(index>=0 && index<MAX_GUILD_STORAGE) { // valid index - if( (amount <= stor->storage[index].amount) && (amount > 0) ) { //valid amount - if((flag = pc_additem(sd,&stor->storage[index],amount)) == 0) + if( (amount <= stor->storage_[index].amount) && (amount > 0) ) { //valid amount + if((flag = pc_additem(sd,&stor->storage_[index],amount)) == 0) guild_storage_delitem(sd,stor,index,amount); else clif_additem(sd,0,0,flag); @@ -573,8 +573,8 @@ int storage_guild_storagegettocart(struct map_session_data *sd,int index,int amo if((stor=guild2storage(sd->status.guild_id)) != NULL) { if(stor->storage_status == 1) { // storage open if(index>=0 && index<MAX_GUILD_STORAGE) { // valid index - if( (amount <= stor->storage[index].amount) && (amount > 0) ) { //valid amount - if(pc_cart_additem(sd,&stor->storage[index],amount)==0){ + if( (amount <= stor->storage_[index].amount) && (amount > 0) ) { //valid amount + if(pc_cart_additem(sd,&stor->storage_[index],amount)==0){ guild_storage_delitem(sd,stor,index,amount); } } // valid amount |