summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-04 21:41:51 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-04 21:41:51 +0000
commit8f6d2a3af8da8854ea9bde4b1f73aeb0bc1ea38c (patch)
tree6f687ec1b60cf420f77b1b55f090343ab8bf30e0 /src/map/mob.c
parent95fc41ba7d03c570e9305e2e4dfd35c83598fb89 (diff)
downloadhercules-8f6d2a3af8da8854ea9bde4b1f73aeb0bc1ea38c.tar.gz
hercules-8f6d2a3af8da8854ea9bde4b1f73aeb0bc1ea38c.tar.bz2
hercules-8f6d2a3af8da8854ea9bde4b1f73aeb0bc1ea38c.tar.xz
hercules-8f6d2a3af8da8854ea9bde4b1f73aeb0bc1ea38c.zip
- Some clean-ups in the mob_ai
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6478 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 9f52cbf7b..46129cd35 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -792,7 +792,7 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
switch (bl->type)
{
case BL_PC:
- if (((struct map_session_data*)bl)->state.gangsterparadise &&
+ if (((TBL_PC*)bl)->state.gangsterparadise &&
!(status_get_mode(&md->bl)&MD_BOSS))
return 0; //Gangster paradise protection.
case BL_MOB:
@@ -1038,7 +1038,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
int dist;
int mode;
int search_size;
- int view_range, can_move, can_walk;
+ int view_range, can_move;
md = (struct mob_data*)bl;
tick = va_arg(ap, unsigned int);
@@ -1068,8 +1068,6 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
can_move = (mode&MD_CANMOVE)&&unit_can_move(&md->bl);
//Since can_move is false when you are casting or the damage-delay kicks in, some special considerations
- //must be taken to avoid unlocking the target or triggering rude-attacked skills in said cases. [Skotlex]
- can_walk = DIFF_TICK(tick, md->ud.canmove_tick) > 0;
if (md->target_id)
{ //Check validity of current target. [Skotlex]
@@ -1079,7 +1077,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
(md->ud.walktimer != -1 && !check_distance_bl(&md->bl, tbl, md->min_chase)) ||
(
tbl->type == BL_PC && !(mode&MD_BOSS) &&
- ((struct map_session_data*)tbl)->state.gangsterparadise
+ ((TBL_PC*)tbl)->state.gangsterparadise
)) { //Unlock current target.
if (battle_config.mob_ai&8) //Inmediately stop chasing.
mob_stop_walking(md,1);
@@ -1184,6 +1182,10 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
mob_unlocktarget(md,tick);
return 0;
}
+
+ if (!can_move) //Stuck. Wait before walking.
+ return 0;
+
md->state.skillstate = md->state.aggressive?MSS_FOLLOW:MSS_RUSH;
if (md->ud.walktimer != -1 && md->ud.target == tbl->id &&
(
@@ -1222,7 +1224,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
mob_unlocktarget(md,tick);
return 0;
}
- if (!can_move) // 動けない状態にある
+ if (!can_move) //Stuck. Wait before walking.
return 0;
md->state.skillstate = MSS_LOOT; // ルート時スキル使用
if (!unit_walktobl(&md->bl, tbl, 0, 1))