diff options
author | Haru <haru@dotalux.com> | 2015-08-18 21:57:33 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-08-18 21:57:33 +0200 |
commit | a9042bf0bee2d2453058b22973bea8f335c5a201 (patch) | |
tree | e92d9e43a5b88197557f4430bc42a8e6ff27b9b3 /src/map/script.c | |
parent | eaca495cf99c2311bfa9ecc458f43551b511b6ed (diff) | |
download | hercules-a9042bf0bee2d2453058b22973bea8f335c5a201.tar.gz hercules-a9042bf0bee2d2453058b22973bea8f335c5a201.tar.bz2 hercules-a9042bf0bee2d2453058b22973bea8f335c5a201.tar.xz hercules-a9042bf0bee2d2453058b22973bea8f335c5a201.zip |
Fixed a qiget/qicheck crash in queue iterators
- Fixes #652
- Follow-up to 918b1123963ac2f91a4d074b092ceef1db71b4e8
- Thanks to Dastgir, Andrei Karas
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c index cbbf306d1..efce0b986 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -19091,7 +19091,7 @@ BUILDIN(qiget) { if( idx < 0 || idx >= script->hqis ) { ShowWarning("buildin_qiget: unknown queue iterator id %d\n",idx); script_pushint(st, 0); - } else if ( script->hqi[idx].pos -1 == script->hqi[idx].items ) { + } else if (script->hqi[idx].pos >= script->hqi[idx].items) { script_pushint(st, 0); } else { struct hQueueIterator *it = &script->hqi[idx]; @@ -19108,7 +19108,7 @@ BUILDIN(qicheck) { if( idx < 0 || idx >= script->hqis ) { ShowWarning("buildin_qicheck: unknown queue iterator id %d\n",idx); script_pushint(st, 0); - } else if ( script->hqi[idx].pos -1 == script->hqi[idx].items ) { + } else if (script->hqi[idx].pos >= script->hqi[idx].items) { script_pushint(st, 0); } else { script_pushint(st, 1); |