From c02aa12ef651b47a4f866568558538335d10b8f0 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 27 Jun 2013 20:50:55 -0300 Subject: Map Zone mapflag unload fix map[].units and map[].skills do not store the actual memory, they're pointers. Signed-off-by: shennetsind --- src/map/npc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/npc.c b/src/map/npc.c index df9a9426f..77758bc00 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3412,8 +3412,8 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char if( map[m].units[k] == NULL ) continue; - memmove(&map[m].units[cursor], &map[m].units[k], sizeof(struct mapflag_skill_adjust)); - + map[m].units[cursor] = map[m].units[k]; + cursor++; } if( !( map[m].unit_count = cursor ) ) { @@ -3452,7 +3452,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char ShowWarning("npc_parse_mapflag: Invalid modifier '%d' for skill '%s' for 'adjust_skill_damage' flag! removing flag from %s (file '%s', line '%d').\n", atoi(modifier), skill_name, map[m].name, filepath, strline(buffer,start-buffer)); } else { int idx = map[m].skill_count; - + ARR_FIND(0, idx, k, map[m].skills[k]->skill_id == skill_id); if( k < idx ) { @@ -3466,8 +3466,8 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char if( map[m].skills[k] == NULL ) continue; - memmove(&map[m].skills[cursor], &map[m].skills[k], sizeof(struct mapflag_skill_adjust)); - + map[m].skills[cursor] = map[m].skills[k]; + cursor++; } if( !( map[m].skill_count = cursor ) ) { -- cgit v1.2.3-70-g09d2