summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAnnieRuru <jeankof@ymail.com>2018-06-19 07:51:56 +0800
committerAnnieRuru <jeankof@ymail.com>2018-06-19 07:51:56 +0800
commit90de9174210664e1c5af4db59868709d25226545 (patch)
tree97197ca4a790e9b2c353b46c3c8acae41aac7e9a /src/map/script.c
parentb57232ac29732ff526eca750dee295a871861ed6 (diff)
downloadhercules-90de9174210664e1c5af4db59868709d25226545.tar.gz
hercules-90de9174210664e1c5af4db59868709d25226545.tar.bz2
hercules-90de9174210664e1c5af4db59868709d25226545.tar.xz
hercules-90de9174210664e1c5af4db59868709d25226545.zip
Fix SCRIPT_MAX_ARRAYSIZE
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 410a707f1..f5b522ffb 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4884,7 +4884,7 @@ void script_cleararray_pc(struct map_session_data* sd, const char* varname, void
void script_setarray_pc(struct map_session_data* sd, const char* varname, uint32 idx, void* value, int* refcache) {
int key;
- if( idx >= SCRIPT_MAX_ARRAYSIZE ) {
+ if (idx > SCRIPT_MAX_ARRAYSIZE) {
ShowError("script_setarray_pc: Variable '%s' has invalid index '%u' (char_id=%d).\n", varname, idx, sd->status.char_id);
return;
}
@@ -7484,7 +7484,7 @@ BUILDIN(getelementofarray)
id = reference_getid(data);
i = script_getnum(st, 3);
- if (i < 0 || i >= SCRIPT_MAX_ARRAYSIZE) {
+ if (i < 0 || i > SCRIPT_MAX_ARRAYSIZE) {
ShowWarning("script:getelementofarray: index out of range (%"PRId64")\n", i);
script->reportdata(data);
script_pushnil(st);