viewing paste qicheck bug | Diff

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
 src/map/script.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
 
diff --git a/src/map/script.c b/src/map/script.c
index cfc7ed0..bdc12f6 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -19185,6 +19185,7 @@ BUILDIN(qiget)
                script_pushint(st, 0);
                return true;
        }
+       ShowDebug( "qiget %d %d %d %d", VECTOR_INDEX(it->entries, 0), VECTOR_INDEX(it->entries, 1), it->pos, VECTOR_INDEX(it->entries, it->pos) );
        script_pushint(st, VECTOR_INDEX(it->entries, it->pos++));
        return true;
 }
@@ -19212,8 +19213,8 @@ BUILDIN(qicheck)
        }
 
        it = &VECTOR_INDEX(script->hqi, idx);
-
-       if (it->pos <= 0 || it->pos > VECTOR_LENGTH(it->entries)) {
+       ShowDebug( "qicheck %d %d %d", it->pos, VECTOR_INDEX(it->entries, it->pos), VECTOR_LENGTH(it->entries) );
+       if (it->pos < 0 || it->pos >= VECTOR_LENGTH(it->entries)) {
                script_pushint(st, 0);
        } else {
                script_pushint(st, 1);
 
Viewed 839 times, submitted by AnnieRuru.