summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-23 02:20:03 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-23 02:20:03 +0300
commit371293407ca9937a03942a2f8e32f2eb7c87940c (patch)
tree3cc7f056d64216bd144daabfb774db7e7836cef1 /src/map/unit.c
parentab9362782312ad81ef1c1d47dcac464607a710a2 (diff)
downloadevol-hercules-371293407ca9937a03942a2f8e32f2eb7c87940c.tar.gz
evol-hercules-371293407ca9937a03942a2f8e32f2eb7c87940c.tar.bz2
evol-hercules-371293407ca9937a03942a2f8e32f2eb7c87940c.tar.xz
evol-hercules-371293407ca9937a03942a2f8e32f2eb7c87940c.zip
Fix hookStop usage.
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index df875cf..2e6276e 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -26,16 +26,21 @@ int eunit_can_move(struct block_list *bl)
struct unit_data *ud;
struct status_change *sc;
- hookStop();
if (!bl)
+ {
+ hookStop();
return 0;
+ }
ud = unit->bl2ud(bl);
sc = status->get_sc(bl);
sd = BL_CAST(BL_PC, bl);
if (!ud)
+ {
+ hookStop();
return 0;
+ }
if (ud->skilltimer != INVALID_TIMER
&& ud->skill_id != LG_EXEEDBREAK
@@ -43,17 +48,22 @@ int eunit_can_move(struct block_list *bl)
|| !pc->checkskill(sd, SA_FREECAST)
|| skill->get_inf2(ud->skill_id)&INF2_GUILD_SKILL))
{
+ hookStop();
return 0; // prevent moving while casting
}
if (DIFF_TICK(ud->canmove_tick, timer->gettick()) > 0)
+ {
+ hookStop();
return 0;
+ }
if (sd && (
sd->state.vending ||
sd->state.buyingstore ||
sd->state.blockedmove))
{
+ hookStop();
return 0; //Can't move
}
@@ -99,6 +109,7 @@ int eunit_can_move(struct block_list *bl)
|| (sc->data[SC_DANCING]->val1&0xFFFF) == CG_MOONLIT
|| (sc->data[SC_DANCING]->val1&0xFFFF) == CG_HERMODE))))
{
+ hookStop();
return 0;
}
if (sc->opt1 > 0
@@ -107,11 +118,13 @@ int eunit_can_move(struct block_list *bl)
&& !(sc->opt1 == OPT1_CRYSTALIZE
&& bl->type == BL_MOB))
{
+ hookStop();
return 0;
}
if ((sc->option & OPTION_HIDE) && (!sd || pc->checkskill(sd, RG_TUNNELDRIVE) <= 0))
{
+ hookStop();
return 0;
}
}
@@ -124,9 +137,11 @@ int eunit_can_move(struct block_list *bl)
|| (!(md->status.mode&MD_BOSS) && battle->bc->mob_icewall_walk_block == 1 && map->getcell(bl->m,bl->x,bl->y,CELL_CHKICEWALL))))
{
md->walktoxy_fail_count = 1; //Make sure rudeattacked skills are invoked
+ hookStop();
return 0;
}
}
+ hookStop();
return 1;
}