Changeset - r838:7330f79937ab
[Not reviewed]
master
0 1 0
truelight - 19 years ago 2005-01-01 15:40:44
truelight@openttd.org
(svn r1318) -Fix: Saving a game fucked up the industries.. sorry ;)
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
industry_cmd.c
Show inline comments
 
@@ -1881,29 +1881,29 @@ static const byte _industry_desc[] = {
 
	// reserve extra space in savegame here. (currently 32 bytes)
 
	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 4, 2, 255),
 

	
 
	SLE_END()
 
};
 

	
 
static void Save_INDY()
 
{
 
	Industry *ind;
 
	int i = 0;
 
	// Write the vehicles
 
	FOR_ALL_INDUSTRIES(ind) {
 
		i++;
 
		if (ind->xy != 0) {
 
			SlSetArrayIndex(i);
 
			SlObject(ind, _industry_desc);
 
		}
 
		i++;
 
	}
 
}
 

	
 
static void Load_INDY()
 
{
 
	int index;
 
	_total_industries = 0;
 
	while ((index = SlIterateArray()) != -1) {
 
		SlObject(DEREF_INDUSTRY(index), _industry_desc);
 
		if (index > _total_industries) _total_industries = index;
 
	}
 
}
0 comments (0 inline, 0 general)