summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2015-01-01 18:06:10 +0100
committerHaruna <haru@dotalux.com>2015-01-01 18:06:10 +0100
commitff607f15ec14783aed8c0cf2749ac8cbe6d0e7db (patch)
treee121e6c1e25ff47a26090437c937b022d2bfebc6 /src/map/mob.c
parentdc6b470e4aaf252cb4f960b8b5585e51da821893 (diff)
parentf70d54001cd1b975db6f4668a6d54dbae7a8ac92 (diff)
downloadhercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.gz
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.bz2
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.xz
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.zip
Merge pull request #425 from 4144/fixes
Different fixes after automatic checks
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 4db8cb2f6..ce5854928 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4324,7 +4324,7 @@ bool mob_parse_row_mobskilldb(char** str, int columns, int current)
if( strcmp(str[1],"clear")==0 ){
if (mob_id < 0)
return false;
- memset(mob->db_data[mob_id]->skill,0,sizeof(struct mob_skill));
+ memset(mob->db_data[mob_id]->skill,0,sizeof(struct mob_skill) * MAX_MOBSKILL);
mob->db_data[mob_id]->maxskill=0;
return true;
}
@@ -4716,14 +4716,16 @@ void mob_destroy_mob_db(int index)
{
struct mob_db *data = mob->db_data[index];
int v;
- for (v = 0; v < data->hdatac; v++ ) {
- if (data->hdata[v]->flag.free ) {
- aFree(data->hdata[v]->data);
- }
- aFree(data->hdata[v]);
- }
if (data->hdata)
+ {
+ for (v = 0; v < data->hdatac; v++ ) {
+ if (data->hdata[v]->flag.free ) {
+ aFree(data->hdata[v]->data);
+ }
+ aFree(data->hdata[v]);
+ }
aFree(data->hdata);
+ }
aFree(data);
mob->db_data[index] = NULL;
}