summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c57
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;