Skip to content

Commit

Permalink
fix questinfo data cleaning
Browse files Browse the repository at this point in the history
fixes #2431
  • Loading branch information
Asheraf committed Apr 11, 2019
1 parent 89782fa commit c501b6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/map/map.c
Expand Up @@ -3742,7 +3742,7 @@ static void map_flags_init(void)
map->list[i].short_damage_rate = 100;
map->list[i].long_damage_rate = 100;

VECTOR_INIT(map->list[i].qi_data);
quest->questinfo_vector_clear(i);
}
}

Expand Down Expand Up @@ -5983,18 +5983,18 @@ static void map_add_questinfo(int m, struct questinfo *qi)
nullpo_retv(qi);
Assert_retv(m >= 0 && m < map->count);

if (VECTOR_LENGTH(map->list[m].qi_data) == 0)
VECTOR_INIT(map->list[m].qi_data);
VECTOR_ENSURE(map->list[m].qi_data, 1, 1);
VECTOR_PUSH(map->list[m].qi_data, *qi);
}

static bool map_remove_questinfo(int m, struct npc_data *nd)
{
unsigned short i;

nullpo_retr(false, nd);
Assert_retr(false, m >= 0 && m < map->count);

for (i = 0; i < VECTOR_LENGTH(map->list[m].qi_data); i++) {
for (int i = 0; i < VECTOR_LENGTH(map->list[m].qi_data); i++) {
struct questinfo *qi_data = &VECTOR_INDEX(map->list[m].qi_data, i);
if (qi_data->nd == nd) {
VECTOR_ERASE(map->list[m].qi_data, i);
Expand Down

0 comments on commit c501b6f

Please sign in to comment.