summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-09-09 06:39:47 +0000
committertron <tron@openttd.org>2005-09-09 06:39:47 +0000
commitbf93946d1bf9dd68d577b1f79816a834d370654f (patch)
tree63e0e12acf4b9466cb06d0f00851f99e1e778af4
parent85b5327c436fe9ddcb1ed0d3ccbce8e1397b5c73 (diff)
downloadopenttd-bf93946d1bf9dd68d577b1f79816a834d370654f.tar.xz
(svn r2926) -Fix: Use the same file slots in both initialisation stages when loading a patch grf
-rw-r--r--newgrf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/newgrf.c b/newgrf.c
index 92eb1b2fe..12ecc3aaa 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -2327,6 +2327,7 @@ void LoadNewGRF(uint load_index, uint file_index)
* and load information from it. */
_custom_sprites_base = load_index;
for (stage = 0; stage < 2; stage++) {
+ uint slot = file_index;
uint j;
_cur_stage = stage;
@@ -2337,7 +2338,7 @@ void LoadNewGRF(uint load_index, uint file_index)
error("NewGRF file missing: %s", _newgrf_files[j]);
}
if (stage == 0) InitNewGRFFile(_newgrf_files[j], _cur_spriteid);
- LoadNewGRFFile(_newgrf_files[j], file_index++, stage); // XXX different file indices in both stages?
+ LoadNewGRFFile(_newgrf_files[j], slot++, stage);
DEBUG(spritecache, 2) ("Currently %i sprites are loaded", load_index);
}
}