summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-14 06:21:15 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-14 06:21:15 +0000
commita1e997c5ed5858065770fc6b8018a63fb07f39cd (patch)
tree1325e19c98ea9e89e88a5540735f447e5150bbbc /src/map/mob.c
parent8c4062d16fa6997951d37493f6f581854e5ce7cb (diff)
downloadhercules-a1e997c5ed5858065770fc6b8018a63fb07f39cd.tar.gz
hercules-a1e997c5ed5858065770fc6b8018a63fb07f39cd.tar.bz2
hercules-a1e997c5ed5858065770fc6b8018a63fb07f39cd.tar.xz
hercules-a1e997c5ed5858065770fc6b8018a63fb07f39cd.zip
- Fixed a null pointer when a mob needs to unlock a target while it's idle.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10253 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 4c277de78..2b92438c3 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1025,11 +1025,13 @@ int mob_unlocktarget(struct mob_data *md,int tick)
if (battle_config.mob_ai&0x8)
mob_stop_walking(md,1); //Inmediately stop chasing.
md->state.skillstate = MSS_IDLE;
- md->target_id=0;
- md->ud.target = 0;
md->next_walktime=tick+rand()%3000+3000;
break;
}
+ if (md->target_id) {
+ md->target_id=0;
+ md->ud.target = 0;
+ }
return 0;
}
/*==========================================