summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-06-02 15:22:24 +0200
committerHaru <haru@dotalux.com>2015-06-02 15:22:24 +0200
commit7514b8a5ffc127e94ceec10bffcb7d34f3bb74dd (patch)
treebf96fec3d90a9cfcc765c382c07536ecb147a3ef /src/map
parent425d84689baaef73064885db4dd53a7551cf0551 (diff)
downloadhercules-7514b8a5ffc127e94ceec10bffcb7d34f3bb74dd.tar.gz
hercules-7514b8a5ffc127e94ceec10bffcb7d34f3bb74dd.tar.bz2
hercules-7514b8a5ffc127e94ceec10bffcb7d34f3bb74dd.tar.xz
hercules-7514b8a5ffc127e94ceec10bffcb7d34f3bb74dd.zip
Fixed a crash when a Wink Charm user logs out during the skill effect
- Fixes bugreport:8714, thanks to HermeMaton http://herc.ws/board/tracker/issue-8714-crash/ Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/status.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 34479fdec..299b732ff 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1656,10 +1656,15 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
return 0;
if (sc->data[SC_DC_WINKCHARM] && target && !flag) { //Prevents skill usage
- if( unit->bl2ud(src) && (unit->bl2ud(src))->walktimer == INVALID_TIMER )
- unit->walktobl(src, map->id2bl(sc->data[SC_DC_WINKCHARM]->val2), 3, 1);
- clif->emotion(src, E_LV);
- return 0;
+ struct block_list *winkcharm_target = map->id2bl(sc->data[SC_DC_WINKCHARM]->val2);
+ if (winkcharm_target != NULL) {
+ if (unit->bl2ud(src) && (unit->bl2ud(src))->walktimer == INVALID_TIMER)
+ unit->walktobl(src, map->id2bl(sc->data[SC_DC_WINKCHARM]->val2), 3, 1);
+ clif->emotion(src, E_LV);
+ return 0;
+ } else {
+ status_change_end(src, SC_DC_WINKCHARM, INVALID_TIMER);
+ }
}
if (sc->data[SC_BLADESTOP]) {