diff options
author | Paul Gilbert | 2019-11-03 09:48:24 -0800 |
---|---|---|
committer | Paul Gilbert | 2019-11-11 18:20:30 -0800 |
commit | 381bd5e9a73cd75618a8a5a13f272927aa402187 (patch) | |
tree | c60422e24bf7002827defa5e58ecd50c13c1176a /engines/glk/archetype/saveload.cpp | |
parent | 53fd662ac0bfc0263409290116ad3f76dfee33ac (diff) | |
download | scummvm-rg350-381bd5e9a73cd75618a8a5a13f272927aa402187.tar.gz scummvm-rg350-381bd5e9a73cd75618a8a5a13f272927aa402187.tar.bz2 scummvm-rg350-381bd5e9a73cd75618a8a5a13f272927aa402187.zip |
GLK: ARCHETYPE: Further array indexing fixes
Diffstat (limited to 'engines/glk/archetype/saveload.cpp')
-rw-r--r-- | engines/glk/archetype/saveload.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/glk/archetype/saveload.cpp b/engines/glk/archetype/saveload.cpp index 7c47d77b8d..61069e3161 100644 --- a/engines/glk/archetype/saveload.cpp +++ b/engines/glk/archetype/saveload.cpp @@ -633,7 +633,7 @@ void load_obj_list(Common::ReadStream *f_in, XArrayType &obj_list) { // Objects may be dynamically allocated beneath this limit. It is okay to set that limit // at this time since this routine is only invoked when initially loading a game - Dynamic = obj_list.size(); // TODO: Check if this should be size() + 1 + Dynamic = obj_list.size() + 1; } void dump_obj_list(Common::WriteStream *f_out, XArrayType &obj_list) { @@ -643,7 +643,7 @@ void dump_obj_list(Common::WriteStream *f_out, XArrayType &obj_list) { f_out->writeUint16LE(obj_list.size()); - for (i = 0; i < obj_list.size(); ++i) { + for (i = 1; i <= obj_list.size(); ++i) { if (index_xarray(obj_list, i, p)) { this_obj = (ObjectPtr)p; dump_object(f_out, this_obj); @@ -656,7 +656,7 @@ void dispose_obj_list(XArrayType &obj_list) { void *p; ObjectPtr axe_obj; - for (i = 0; i < obj_list.size(); ++i) { + for (i = 1; i <= obj_list.size(); ++i) { if (index_xarray(obj_list, i, p)) { axe_obj = (ObjectPtr)p; dispose_object(axe_obj); |