diff options
author | Haru <haru@dotalux.com> | 2019-06-01 14:22:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-01 14:22:19 +0200 |
commit | c8202e1cd9eb64d07fa921d117a13eef3938a4db (patch) | |
tree | e57701639ffb1e518431dc0e0a10860aa7c642d6 /src/map/script.c | |
parent | d7042459c9f9797a80dadce57297b5d16e8931c4 (diff) | |
parent | a321a26f2f9867c8c0e4b5503e4ad2275801122e (diff) | |
download | hercules-c8202e1cd9eb64d07fa921d117a13eef3938a4db.tar.gz hercules-c8202e1cd9eb64d07fa921d117a13eef3938a4db.tar.bz2 hercules-c8202e1cd9eb64d07fa921d117a13eef3938a4db.tar.xz hercules-c8202e1cd9eb64d07fa921d117a13eef3938a4db.zip |
Merge pull request #2433 from Asheraf/questinfomemfix
Move questinfo data from map to npc_data
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/map/script.c b/src/map/script.c index 5843ac292..8d001f3fe 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -21256,7 +21256,6 @@ static BUILDIN(questinfo) return false; } - qi.nd = nd; qi.icon = quest->questinfo_validate_icon(icon); if (script_hasdata(st, 3)) { int color = script_getnum(st, 3); @@ -21268,7 +21267,9 @@ static BUILDIN(questinfo) qi.color = (unsigned char)color; } - map->add_questinfo(nd->bl.m, &qi); + VECTOR_ENSURE(nd->qi_data, 1, 1); + VECTOR_PUSH(nd->qi_data, qi); + map->add_questinfo(nd->bl.m, nd); return true; } @@ -21286,15 +21287,12 @@ static BUILDIN(setquestinfo) return false; } - qi = &VECTOR_LAST(map->list[nd->bl.m].qi_data); + qi = &VECTOR_LAST(nd->qi_data); if (qi == NULL) { ShowWarning("buildin_setquestinfo: no valide questinfo data has been found for this npc.\n"); return false; } - if (qi->nd != nd) { - ShowWarning("buildin_setquestinfo: invalid usage, setquestinfo must be used only after questinfo.\n"); - return false; - } + switch (type) { case QINFO_JOB: { |