From abe4b83a81c437d404aadea723165d98c33d462d Mon Sep 17 00:00:00 2001 From: Asheraf Date: Sun, 21 Apr 2019 17:07:47 +0100 Subject: Move questinfo data from map to npc_data this will fix the issue where having multiple `questinfo()` blocks wont work properly --- src/map/script.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/map/script.c') 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: { -- cgit v1.2.3-60-g2f50