diff options
| author | Paul Gilbert | 2019-11-02 22:02:45 -0700 |
|---|---|---|
| committer | Paul Gilbert | 2019-11-11 18:20:30 -0800 |
| commit | c570d6f4b29e62f6177bf3c046d0e5761c57b5cc (patch) | |
| tree | ba2641875eb1cc44f51d6c340e5f78008c7f28a3 /engines/glk/archetype/array.cpp | |
| parent | a3c646133f9c173b23ff775e03563e337be1cdaf (diff) | |
| download | scummvm-rg350-c570d6f4b29e62f6177bf3c046d0e5761c57b5cc.tar.gz scummvm-rg350-c570d6f4b29e62f6177bf3c046d0e5761c57b5cc.tar.bz2 scummvm-rg350-c570d6f4b29e62f6177bf3c046d0e5761c57b5cc.zip | |
GLK: ARCHETYPE: Fix array indexing to match original's 1 based
Diffstat (limited to 'engines/glk/archetype/array.cpp')
| -rw-r--r-- | engines/glk/archetype/array.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/glk/archetype/array.cpp b/engines/glk/archetype/array.cpp index b816306fc3..79a486faf1 100644 --- a/engines/glk/archetype/array.cpp +++ b/engines/glk/archetype/array.cpp @@ -38,15 +38,15 @@ void append_to_xarray(XArrayType &the_xarray, void *element) { } bool access_xarray(XArrayType &the_xarray, int index, void *&result, AccessType direction) { - if (index < 0 || index >= (int)the_xarray.size()) + if (index < 1 || index > (int)the_xarray.size()) return false; switch (direction) { case PEEK_ACCESS: - result = the_xarray[index]; + result = the_xarray[index - 1]; break; case POKE_ACCESS: - the_xarray[index] = result; + the_xarray[index - 1] = result; break; } |
