summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index ccc4264d9..17721caff 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -47,6 +47,7 @@
#include "map/refine.h"
#include "map/script.h"
#include "map/status.h"
+#include "map/storage.h"
#include "map/unit.h"
#include "common/cbasetypes.h"
#include "common/ers.h"
@@ -11354,17 +11355,21 @@ static int skill_castend_map(struct map_session_data *sd, uint16 skill_id, const
return 0;
}
- switch(skill_id) {
+ switch (skill_id) {
case AL_TELEPORT:
- // The storage window is closed automatically by the client when there's
- // any kind of map change, so we need to restore it automatically
- // issue: 8027
- if(strcmp(mapname,"Random")==0)
- pc->randomwarp(sd,CLR_TELEPORT);
- else if (sd->menuskill_val > 1) //Need lv2 to be able to warp here.
- pc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
-
- clif->refresh_storagewindow(sd);
+ if (strcmp(mapname, "Random") == 0)
+ pc->randomwarp(sd, CLR_TELEPORT);
+ else if (sd->menuskill_val > 1) // Need lv2 to be able to warp here.
+ pc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
+
+ if (battle_config.teleport_close_storage == 1 && sd->state.storage_flag != STORAGE_FLAG_CLOSED) {
+ if (sd->state.storage_flag == STORAGE_FLAG_NORMAL)
+ storage->close(sd);
+ if (sd->state.storage_flag == STORAGE_FLAG_GUILD)
+ gstorage->close(sd);
+ } else {
+ clif->refresh_storagewindow(sd);
+ }
break;
case AL_WARP: