- Fixed @storeall and @charstoreall failing when the target character already had the storage open.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7656 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-07-13 16:33:44 +00:00
parent a4103cbab4
commit d984baa013
3 changed files with 30 additions and 9 deletions

View File

@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/07/13 2006/07/13
* Fixed @storeall and @charstoreall failing when the target character
already had the storage open. [Skotlex]
* Reverted temporarily the Cart Termination equation until it can be * Reverted temporarily the Cart Termination equation until it can be
fixed... [Skotlex] fixed... [Skotlex]
* Fixed script command "recovery". [Skotlex] * Fixed script command "recovery". [Skotlex]

View File

@ -7142,9 +7142,17 @@ atcommand_storeall(const int fd, struct map_session_data* sd,
{ {
int i; int i;
nullpo_retr(-1, sd); nullpo_retr(-1, sd);
if (storage_storageopen(sd) == 1) {
if (sd->state.storage_flag != 1)
{ //Open storage.
switch (storage_storageopen(sd)) {
case 2: //Try again
clif_displaymessage(fd, "run this command again.."); clif_displaymessage(fd, "run this command again..");
return 0; return 0;
case 1: //Failure
clif_displaymessage(fd, "You can't open the storage currently.");
return 1;
}
} }
for (i = 0; i < MAX_INVENTORY; i++) { for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) { if (sd->status.inventory[i].amount) {
@ -7177,11 +7185,19 @@ atcommand_charstoreall(const int fd, struct map_session_data* sd,
if((pl_sd=map_nick2sd((char *) message)) == NULL) if((pl_sd=map_nick2sd((char *) message)) == NULL)
return -1; return -1;
if (storage_storageopen(pl_sd) == 1) { if (pl_sd->state.storage_flag != 1)
{ //Open storage.
switch (storage_storageopen(pl_sd)) {
case 2: //Try again
clif_displaymessage(fd, "Had to open the characters storage window..."); clif_displaymessage(fd, "Had to open the characters storage window...");
clif_displaymessage(fd, "run this command again.."); clif_displaymessage(fd, "run this command again..");
return 0; return 0;
case 1: //Failure
clif_displaymessage(fd, "The character currently can't use the storage.");
return 1;
} }
}
for (i = 0; i < MAX_INVENTORY; i++) { for (i = 0; i < MAX_INVENTORY; i++) {
if (pl_sd->status.inventory[i].amount) { if (pl_sd->status.inventory[i].amount) {
if(pl_sd->status.inventory[i].equip != 0) if(pl_sd->status.inventory[i].equip != 0)

View File

@ -118,7 +118,10 @@ int storage_delete(int account_id)
} }
/*========================================== /*==========================================
* * Opens a storage. Returns:
* 0 - success
* 1 - fail
* 2 - Storage requested from char-server (will open automatically later)
*------------------------------------------ *------------------------------------------
*/ */
int storage_storageopen(struct map_session_data *sd) int storage_storageopen(struct map_session_data *sd)
@ -141,7 +144,7 @@ int storage_storageopen(struct map_session_data *sd)
if((stor = idb_get(storage_db,sd->status.account_id)) == NULL) if((stor = idb_get(storage_db,sd->status.account_id)) == NULL)
{ //Request storage. { //Request storage.
intif_request_storage(sd->status.account_id); intif_request_storage(sd->status.account_id);
return 1; return 2;
} }
if (stor->storage_status) if (stor->storage_status)