diff options
author | panikon <panikon@zoho.com> | 2014-04-19 21:39:40 -0300 |
---|---|---|
committer | panikon <panikon@zoho.com> | 2014-04-19 21:39:40 -0300 |
commit | 31486a8c3340a8ca8a8b1e5dd9084c2c07ec8614 (patch) | |
tree | 451f55c703d03d06d7035d61e1fded420634580a /src/map/clif.c | |
parent | 97cd487deb324fb23d9f671d0c1ed739d52d5935 (diff) | |
download | hercules-31486a8c3340a8ca8a8b1e5dd9084c2c07ec8614.tar.gz hercules-31486a8c3340a8ca8a8b1e5dd9084c2c07ec8614.tar.bz2 hercules-31486a8c3340a8ca8a8b1e5dd9084c2c07ec8614.tar.xz hercules-31486a8c3340a8ca8a8b1e5dd9084c2c07ec8614.zip |
Follow up to 6f6a6b3
* Added new method to handle refreshing the storage window when it was closed automatically by the client
* http://hercules.ws/board/tracker/issue-8027-when-the-storage-is-open-you-can-use-self-skills
* http://hercules.ws/board/tracker/issue-7694-guild-notice
Follow up to d57781c
* Fixed minor typo as pointed by @MishimaHaruna
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index d0fb08486..2fbf64e09 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8420,6 +8420,34 @@ void clif_message(struct block_list* bl, const char* msg) { clif->send(buf, WBUFW(buf,2), bl, AREA_CHAT_WOC); } +/** + * Notifies the client that the storage window is still open + * + * Should only be used in cases where the client closed the + * storage window without server's consent + **/ +void clif_refresh_storagewindow( struct map_session_data *sd ) { + // Notify the client that the storage is open + if( sd->state.storage_flag == 1 ) { + storage->sortitem(sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items)); + clif->storagelist(sd, sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items)); + clif->updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE); + } + // Notify the client that the gstorage is open otherwise it will + // remain locked forever and nobody will be able to access it + if( sd->state.storage_flag == 2 ) { + struct guild_storage *gstor; + if( (gstor = gstorage->id2storage2(sd->status.guild_id)) == NULL) { + // Shouldn't happen... The information should already be at the map-server + intif->request_guild_storage(sd->status.account_id,sd->status.guild_id); + } else { + storage->sortitem(gstor->items, ARRAYLENGTH(gstor->items)); + clif->storagelist(sd, gstor->items, ARRAYLENGTH(gstor->items)); + clif->updatestorageamount(sd, gstor->storage_amount, MAX_GUILD_STORAGE); + } + } +} + // refresh the client's screen, getting rid of any effects void clif_refresh(struct map_session_data *sd) { @@ -8480,26 +8508,7 @@ void clif_refresh(struct map_session_data *sd) pc->disguise(sd, disguise); } - // Notify the client that the storage is open - if( sd->state.storage_flag == 1 ) { - storage->sortitem(sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items)); - clif->storagelist(sd, sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items)); - clif->updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE); - } - // Notify the client that the gstorage is open otherwise it will - // remain locked forever and nobody will be able to access it - if( sd->state.storage_flag == 2 ) { - struct guild_storage *gstor; - if( (gstor = gstorage->id2storage2(sd->status.guild_id)) == NULL) { - // Shouldn't happen... The information should already be at the map-server - intif->request_guild_storage(sd->status.account_id,sd->status.guild_id); - } else { - storage->sortitem(gstor->items, ARRAYLENGTH(gstor->items)); - clif->storagelist(sd, gstor->items, ARRAYLENGTH(gstor->items)); - clif->updatestorageamount(sd, gstor->storage_amount, MAX_GUILD_STORAGE); - } - } - + clif->refresh_storagewindow(sd); } @@ -11361,10 +11370,6 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) ) return; - // Some self skills need to close the storage to work properly - if( skill_id == AL_TELEPORT && sd->state.storage_flag ) - storage->close(sd); - if( pc_issit(sd) ) return; @@ -11565,7 +11570,8 @@ void clif_parse_UseSkillMap(int fd, struct map_session_data* sd) if(skill_id != sd->menuskill_id) return; - if( pc_cant_act(sd) ) { + // It is possible to use teleport with the storage window open issue:8027 + if( pc_cant_act(sd) && (!sd->state.storage_flag && skill_id != AL_TELEPORT) ) { clif_menuskill_clear(sd); return; } @@ -18666,6 +18672,7 @@ void clif_defaults(void) { clif->sitting = clif_sitting; clif->standing = clif_standing; clif->arrow_create_list = clif_arrow_create_list; + clif->refresh_storagewindow = clif_refresh_storagewindow; clif->refresh = clif_refresh; clif->fame_blacksmith = clif_fame_blacksmith; clif->fame_alchemist = clif_fame_alchemist; |