(svn r2926) -Fix: Use the same file slots in both initialisation stages when loading a patch grf
authortron
Fri, 09 Sep 2005 06:39:47 +0000
changeset 2400 2b258097156f
parent 2399 430ab3acb2a5
child 2401 7e90848c440d
(svn r2926) -Fix: Use the same file slots in both initialisation stages when loading a patch grf
newgrf.c
--- a/newgrf.c	Thu Sep 08 14:31:13 2005 +0000
+++ b/newgrf.c	Fri Sep 09 06:39:47 2005 +0000
@@ -2327,6 +2327,7 @@
 	 * 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 @@
 				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);
 		}
 	}