diff options
author | Asheraf <acheraf1998@gmail.com> | 2019-04-21 17:07:47 +0100 |
---|---|---|
committer | Asheraf <acheraf1998@gmail.com> | 2019-05-06 19:59:30 +0000 |
commit | abe4b83a81c437d404aadea723165d98c33d462d (patch) | |
tree | e6b5eaeda12876358d6a00636d20bc311502f8ad /src/map/script.c | |
parent | 403939af8bdb08e33f9b0a6613fe2e5e00bbea04 (diff) | |
download | hercules-abe4b83a81c437d404aadea723165d98c33d462d.tar.gz hercules-abe4b83a81c437d404aadea723165d98c33d462d.tar.bz2 hercules-abe4b83a81c437d404aadea723165d98c33d462d.tar.xz hercules-abe4b83a81c437d404aadea723165d98c33d462d.zip |
Move questinfo data from map to npc_data
this will fix the issue where having multiple `questinfo()` blocks wont work properly
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: { |