From c0f2069689110d1df816d52e36d049d4b97a7a22 Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 15 May 2009 10:27:05 +0000 Subject: - Fixed a bunch of invalid memory access bugs as reported by Valgrind. - Updated unit_stop_walking to not move character an extra cell when it is already half-way there unless flag 0x4 is passed. (bugreport:3078) - Fixed the monster MD_CASTSENSOR code not correctly setting the monster's aggressive state. - Corrected a few compiler warnings - Changed a bit the code for SC_BOSSMAPINFO so it is not so hideously ugly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13774 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/map/mob.c') diff --git a/src/map/mob.c b/src/map/mob.c index 42e00b9ec..d6ac54517 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3281,12 +3281,16 @@ int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char return md->bl.id; } -int mob_clone_delete(int class_) +int mob_clone_delete(struct mob_data *md) { + const int class_ = md->class_; if (class_ >= MOB_CLONE_START && class_ < MOB_CLONE_END && mob_db_data[class_]!=NULL) { aFree(mob_db_data[class_]); mob_db_data[class_]=NULL; + //Clear references to the db + md->db = NULL; + md->vd = NULL; return 1; } return 0; @@ -4134,7 +4138,6 @@ static int mob_readskilldb(void) while(fgets(line, sizeof(line), fp)) { char *str[20], *p, *np; - int j=0; lines++; if(line[0] == '/' && line[1] == '/') -- cgit v1.2.3-70-g09d2