summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-15 10:27:05 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-15 10:27:05 +0000
commitc0f2069689110d1df816d52e36d049d4b97a7a22 (patch)
tree79b5d2a9dbaff90eaf32470e1fd586f8c7ad43aa /src/map/mob.c
parentf51be442a0990eb5755e10346abaeb94404af2b1 (diff)
downloadhercules-c0f2069689110d1df816d52e36d049d4b97a7a22.tar.gz
hercules-c0f2069689110d1df816d52e36d049d4b97a7a22.tar.bz2
hercules-c0f2069689110d1df816d52e36d049d4b97a7a22.tar.xz
hercules-c0f2069689110d1df816d52e36d049d4b97a7a22.zip
- 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
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c7
1 files changed, 5 insertions, 2 deletions
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] == '/')