diff options
author | Dennis Friis <peavey@inspircd.org> | 2009-06-23 01:35:07 +0200 |
---|---|---|
committer | Dennis Friis <peavey@inspircd.org> | 2009-06-25 01:13:20 +0200 |
commit | 2f8f562c2c85aaff8fe2f12c2f4ab3092f53bd9c (patch) | |
tree | 1f3e5351556519137c137942f78ef92f36bf67f3 | |
parent | 85f88cd23756be9be2028e0ca13cf1449e38c858 (diff) | |
download | tmwa-2f8f562c2c85aaff8fe2f12c2f4ab3092f53bd9c.tar.gz tmwa-2f8f562c2c85aaff8fe2f12c2f4ab3092f53bd9c.tar.bz2 tmwa-2f8f562c2c85aaff8fe2f12c2f4ab3092f53bd9c.tar.xz tmwa-2f8f562c2c85aaff8fe2f12c2f4ab3092f53bd9c.zip |
More fixes to storage derived from ea stable.
-rw-r--r-- | src/map/atcommand.c | 18 | ||||
-rw-r--r-- | src/map/clif.c | 30 | ||||
-rw-r--r-- | src/map/guild.c | 2 | ||||
-rw-r--r-- | src/map/intif.c | 6 | ||||
-rw-r--r-- | src/map/pc.c | 7 | ||||
-rw-r--r-- | src/map/trade.c | 13 |
6 files changed, 38 insertions, 38 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 4696f60..e85ca7d 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1457,13 +1457,13 @@ int atcommand_storage( struct storage *stor; //changes from Freya/Yor nullpo_retr(-1, sd); - if (sd->state.storage_flag == 1) { - clif_displaymessage(fd, "You have opened your guild storage. Close it before."); + if (sd->state.storage_flag) { + clif_displaymessage(fd, msg_table[250]); return -1; } if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) { - clif_displaymessage(fd, "You have already opened your storage."); + clif_displaymessage(fd, msg_table[250]); return -1; } @@ -1472,6 +1472,7 @@ int atcommand_storage( return 0; } + /*========================================== * *------------------------------------------ @@ -1484,18 +1485,18 @@ int atcommand_guildstorage( nullpo_retr(-1, sd); if (sd->status.guild_id > 0) { - if (sd->state.storage_flag == 1) { - clif_displaymessage(fd, "You have already opened your guild storage."); + if (sd->state.storage_flag) { + clif_displaymessage(fd, msg_table[251]); return -1; } if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) { - clif_displaymessage(fd, "Your storage is opened. Close it before."); + clif_displaymessage(fd, msg_table[251]); return -1; } storage_guild_storageopen(sd); } else { - clif_displaymessage(fd, "You are not in a guild."); - return -1; + clif_displaymessage(fd, msg_table[252]); + return -1; } return 0; @@ -1510,6 +1511,7 @@ int atcommand_option( const char* command, const char* message) { int param1 = 0, param2 = 0, param3 = 0; + nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%d %d %d", ¶m1, ¶m2, ¶m3) < 1 || param1 < 0 || param2 < 0 || param3 < 0) { clif_displaymessage(fd, "Please, enter at least a option (usage: @option <param1:0+> <param2:0+> <param3:0+>)."); diff --git a/src/map/clif.c b/src/map/clif.c index 2ca7e68..ad65f88 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7540,10 +7540,10 @@ void clif_parse_MoveToKafra(int fd, struct map_session_data *sd) { if (sd->npc_id != 0 && !sd->npc_flags.storage) return; - if (sd->state.storage_flag) - storage_guild_storageadd(sd, item_index, item_amount); - else + if (sd->state.storage_flag == 1) storage_storageadd(sd, item_index, item_amount); + else if (sd->state.storage_flag == 2) + storage_guild_storageadd(sd, item_index, item_amount); } /*========================================== @@ -7561,10 +7561,10 @@ void clif_parse_MoveFromKafra(int fd,struct map_session_data *sd) { if (sd->npc_id != 0 && !sd->npc_flags.storage) return; - if (sd->state.storage_flag) - storage_guild_storageget(sd, item_index, item_amount); - else + if (sd->state.storage_flag == 1) storage_storageget(sd, item_index, item_amount); + else if(sd->state.storage_flag == 2) + storage_guild_storageget(sd, item_index, item_amount); } /*========================================== @@ -7576,10 +7576,10 @@ void clif_parse_MoveToKafraFromCart(int fd, struct map_session_data *sd) { if (sd->npc_id != 0 && !sd->npc_flags.storage) return; - if (sd->state.storage_flag) - storage_guild_storageaddfromcart(sd, RFIFOW(fd,2) - 2, RFIFOL(fd,4)); - else + if (sd->state.storage_flag == 1) storage_storageaddfromcart(sd, RFIFOW(fd,2) - 2, RFIFOL(fd,4)); + else if (sd->state.storage_flag == 2) + storage_guild_storageaddfromcart(sd, RFIFOW(fd,2) - 2, RFIFOL(fd,4)); } /*========================================== @@ -7591,10 +7591,10 @@ void clif_parse_MoveFromKafraToCart(int fd, struct map_session_data *sd) { if (sd->npc_id != 0) return; - if (sd->state.storage_flag) - storage_guild_storagegettocart(sd, RFIFOW(fd,2)-1, RFIFOL(fd,4)); - else + if (sd->state.storage_flag == 1) storage_storagegettocart(sd, RFIFOW(fd,2)-1, RFIFOL(fd,4)); + else if (sd->state.storage_flag == 2) + storage_guild_storagegettocart(sd, RFIFOW(fd,2)-1, RFIFOL(fd,4)); } /*========================================== @@ -7604,10 +7604,10 @@ void clif_parse_MoveFromKafraToCart(int fd, struct map_session_data *sd) { void clif_parse_CloseKafra(int fd, struct map_session_data *sd) { nullpo_retv(sd); - if (sd->state.storage_flag) - storage_guild_storageclose(sd); - else + if (sd->state.storage_flag == 1) storage_storageclose(sd); + else if (sd->state.storage_flag == 2) + storage_guild_storageclose(sd); if (sd->npc_flags.storage) { sd->npc_flags.storage = 0; diff --git a/src/map/guild.c b/src/map/guild.c index c32ebb4..2643280 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1214,7 +1214,7 @@ int guild_broken(int guild_id,int flag) for(i=0;i<g->max_member;i++){ // ƒMƒ‹ƒh‰ðŽU‚ð’Ê’m if((sd=g->member[i].sd)!=NULL){ - if(sd->state.storage_flag) + if(sd->state.storage_flag == 2) storage_guild_storage_quit(sd,1); sd->status.guild_id=0; sd->guild_sended=0; diff --git a/src/map/intif.c b/src/map/intif.c index ae8e906..ca9d3c3 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -595,7 +595,7 @@ int intif_parse_LoadStorage(int fd) { printf("intif_openstorage: %d\n",RFIFOL(fd,4) ); memcpy(stor,RFIFOP(fd,8),sizeof(struct storage)); stor->storage_status=1; - sd->state.storage_flag = 0; + sd->state.storage_flag = 1; clif_storageitemlist(sd,stor); clif_storageequiplist(sd,stor); clif_updatestorageamount(sd,stor); @@ -608,6 +608,7 @@ int intif_parse_SaveStorage(int fd) { if(battle_config.save_log) printf("intif_savestorage: done %d %d\n",RFIFOL(fd,2),RFIFOB(fd,6) ); + storage_storage_saved(RFIFOL(fd,2)); return 0; } @@ -639,7 +640,7 @@ int intif_parse_LoadGuildStorage(int fd) printf("intif_open_guild_storage: %d\n",RFIFOL(fd,4) ); memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage)); gstor->storage_status = 1; - sd->state.storage_flag = 1; + sd->state.storage_flag = 2; clif_guildstorageitemlist(sd,gstor); clif_guildstorageequiplist(sd,gstor); clif_updateguildstorageamount(sd,gstor); @@ -651,6 +652,7 @@ int intif_parse_SaveGuildStorage(int fd) if(battle_config.save_log) { printf("intif_save_guild_storage: done %d %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOB(fd,10) ); } + storage_guild_storagesaved(RFIFOL(fd,2), RFIFOL(fd,6)); return 0; } diff --git a/src/map/pc.c b/src/map/pc.c index 537e978..2a36438 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3424,10 +3424,10 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt chat_leavechat(sd); if(sd->trade_partner) // �����𒆒f���� trade_tradecancel(sd); - if(sd->state.storage_flag) - storage_guild_storage_quit(sd,0); - else + if(sd->state.storage_flag == 1) storage_storage_quit(sd); // �q�ɂ��J���Ă��Ȃ��ۑ����� + else if (sd->state.storage_flag == 2) + storage_guild_storage_quit(sd,0); if(sd->party_invite>0) // �p�[�e�B���U��ۂ��� party_reply_invite(sd,sd->party_invite_account,0); @@ -3495,6 +3495,7 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt } else if (sd->state.storage_flag == 2) storage_guild_storageclose(sd); + chrif_changemapserver(sd, mapname, x, y, ip, port); return 0; } diff --git a/src/map/trade.c b/src/map/trade.c index e804ad7..8880629 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -62,8 +62,6 @@ void trade_traderequest(struct map_session_data *sd,int target_id) void trade_tradeack(struct map_session_data *sd,int type) { struct map_session_data *target_sd; - struct storage *stor; - nullpo_retv(sd); if((target_sd = map_id2sd(sd->trade_partner)) != NULL){ @@ -81,13 +79,10 @@ void trade_tradeack(struct map_session_data *sd,int type) npc_event_dequeue(target_sd); //close STORAGE window if it's open. It protects from spooffing packets [Lupus] - nullpo_retv(stor=account2storage2(sd->status.account_id)); - if(stor->storage_status == 1) { - if (sd->state.storage_flag) //is it Guild Storage or Common - storage_guild_storageclose(sd); - else - storage_storageclose(sd); - }//END OF STORAGE CLOSE + if (sd->state.storage_flag == 1) + storage_storageclose(sd); + else if (sd->state.storage_flag == 2) + storage_guild_storageclose(sd); } } |