diff options
author | Haru <haru@dotalux.com> | 2020-04-06 05:18:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 05:18:14 +0200 |
commit | 1ae5a4cb1003b9c336c315142e66a5e5b7f3ca32 (patch) | |
tree | 74d92f0d0f3cda2a2de3e9d7b2c2b6203afc1e48 /src/map/script.c | |
parent | ab640e4745afdf771709dce826aee97e0e4670fd (diff) | |
parent | 58c4ce73b9fdc1d67a928e37742510bf49bb7dbc (diff) | |
download | hercules-1ae5a4cb1003b9c336c315142e66a5e5b7f3ca32.tar.gz hercules-1ae5a4cb1003b9c336c315142e66a5e5b7f3ca32.tar.bz2 hercules-1ae5a4cb1003b9c336c315142e66a5e5b7f3ca32.tar.xz hercules-1ae5a4cb1003b9c336c315142e66a5e5b7f3ca32.zip |
Merge pull request #2682 from HerculesWS/questinfo_memory_fixes
Questinfo memory violation and handling fixes
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c index 3d5534a47..c08f5e829 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -22085,12 +22085,13 @@ static BUILDIN(setquestinfo) return false; } - qi = &VECTOR_LAST(nd->qi_data); - if (qi == NULL) { + if (VECTOR_LENGTH(nd->qi_data) == 0) { ShowWarning("buildin_setquestinfo: no valide questinfo data has been found for this npc.\n"); return false; } + qi = &VECTOR_LAST(nd->qi_data); + switch (type) { case QINFO_JOB: { |