summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-27 20:50:55 -0300
committershennetsind <ind@henn.et>2013-06-27 20:50:55 -0300
commitc02aa12ef651b47a4f866568558538335d10b8f0 (patch)
treeb335a91b6464b7c8e8ceb42a02c5d208c3c7e4e2 /src/map
parentbd509c99b5015b3590d25598ae1ddabcb3c01434 (diff)
downloadhercules-c02aa12ef651b47a4f866568558538335d10b8f0.tar.gz
hercules-c02aa12ef651b47a4f866568558538335d10b8f0.tar.bz2
hercules-c02aa12ef651b47a4f866568558538335d10b8f0.tar.xz
hercules-c02aa12ef651b47a4f866568558538335d10b8f0.zip
Map Zone mapflag unload fix
map[].units and map[].skills do not store the actual memory, they're pointers. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/npc.c10
1 files 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 ) ) {