Changeset - r123:d36538b7e502
[Not reviewed]
master
0 4 0
dominik - 20 years ago 2004-08-23 21:29:25
dominik@openttd.org
(svn r124) Prepared code for removal of block_months variable in next major savegame version
4 files changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
oldloader.c
Show inline comments
 
@@ -97,25 +97,25 @@ typedef struct {
 
	byte alpha_order_obsolete;	// alpha_order is obsolete since savegame format 4
 
	byte namewidth_1, namewidth_2;
 
	uint16 string_id;
 
	int16 sign_left, sign_top;
 
	uint16 had_vehicle_of_type;
 
	OldGoodsEntry goods[12];
 
	byte time_since_load, time_since_unload;
 
	byte delete_ctr;
 
	byte owner;
 
	byte facilities;
 
	byte airport_type;
 
	byte truck_stop_status, bus_stop_status;
 
	byte blocked_months;
 
	byte blocked_months_obsolete;
 
	byte unk85;
 
	uint16 airport_flags;
 
	uint16 last_vehicle;
 
	uint32 unk8A;
 
} GCC_PACK OldStation;
 
assert_compile(sizeof(OldStation) == 0x8E);
 

	
 
typedef struct {
 
	uint16 xy;
 
	uint32 town;
 
	byte width;
 
	byte height;
 
@@ -699,25 +699,25 @@ static void FixStation(Station *s, OldSt
 
		
 
		s->string_id = RemapOldStringID(o->string_id);
 
		s->had_vehicle_of_type = o->had_vehicle_of_type;
 
		FixGoodsEntry(s->goods, o->goods, lengthof(o->goods));
 
		s->time_since_load = o->time_since_load;
 
		s->time_since_unload = o->time_since_unload;
 
		s->delete_ctr = o->delete_ctr;
 
		s->owner = o->owner;
 
		s->facilities = o->facilities;
 
		s->airport_type = o->airport_type;
 
		s->truck_stop_status = o->truck_stop_status;
 
		s->bus_stop_status = o->bus_stop_status;
 
		s->blocked_months = o->blocked_months;
 
		s->blocked_months_obsolete = o->blocked_months_obsolete;
 
		s->airport_flags = o->airport_flags;
 
		s->last_vehicle = o->last_vehicle;
 
	} while (s++,o++,--num);
 
}
 

	
 
static void FixDepot(Depot *n, OldDepot *o, int num)
 
{
 
	do {
 
		n->town_index = REMAP_TOWN_IDX(o->town);
 
		n->xy = o->xy;
 
	} while (n++,o++,--num);
 
}
station.h
Show inline comments
 
@@ -28,25 +28,25 @@ struct Station {
 
	ViewportSign sign;
 

	
 
	uint16 had_vehicle_of_type;
 
	
 
	byte time_since_load;
 
	byte time_since_unload;
 
	byte delete_ctr;
 
	byte owner;
 
	byte facilities;
 
	byte airport_type;
 
	byte truck_stop_status;
 
	byte bus_stop_status;
 
	byte blocked_months;
 
	byte blocked_months_obsolete;
 

	
 
	// trainstation width/height
 
	byte trainst_w, trainst_h;
 

	
 
	byte stat_id, class_id;
 
	uint16 build_date;
 

	
 
	//uint16 airport_flags;
 
  uint32 airport_flags;
 
	uint16 index;
 

	
 
	VehicleID last_vehicle;
station_cmd.c
Show inline comments
 
@@ -2501,25 +2501,27 @@ static const byte _station_desc[] = {
 

	
 
	SLE_VAR(Station,string_id,			SLE_STRINGID),
 
	SLE_VAR(Station,had_vehicle_of_type,SLE_UINT16),
 

	
 
	SLE_VAR(Station,time_since_load,		SLE_UINT8),
 
	SLE_VAR(Station,time_since_unload,	SLE_UINT8),
 
	SLE_VAR(Station,delete_ctr,					SLE_UINT8),
 
	SLE_VAR(Station,owner,							SLE_UINT8),
 
	SLE_VAR(Station,facilities,					SLE_UINT8),
 
	SLE_VAR(Station,airport_type,				SLE_UINT8),
 
	SLE_VAR(Station,truck_stop_status,	SLE_UINT8),
 
	SLE_VAR(Station,bus_stop_status,		SLE_UINT8),
 
	SLE_VAR(Station,blocked_months,			SLE_UINT8),
 
			
 
	// blocked_months was stored here in savegame format 0 - 4.0
 
	SLE_CONDVAR(Station,blocked_months_obsolete,	SLE_UINT8, 0, 4),
 

	
 
	SLE_CONDVAR(Station,airport_flags,			SLE_VAR_U32 | SLE_FILE_U16, 0, 2),
 
	SLE_CONDVAR(Station,airport_flags,			SLE_UINT32, 3, 255),
 

	
 
	SLE_VAR(Station,last_vehicle,				SLE_UINT16),
 

	
 
	SLE_CONDVAR(Station,class_id,				SLE_UINT8, 3, 255),
 
	SLE_CONDVAR(Station,stat_id,				SLE_UINT8, 3, 255),
 
	SLE_CONDVAR(Station,build_date,			SLE_UINT16, 3, 255),
 

	
 
	// reserve extra space in savegame here. (currently 32 bytes)
 
	SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 32, 2, 255),
ttd.c
Show inline comments
 
@@ -1038,25 +1038,25 @@ void CheckIsPlayerActive()
 
		}
 
	}
 
}
 

	
 
// since savegame version 4.1, exclusive transport rights are stored at towns
 
void UpdateExclusiveRights()
 
{
 
	Town *t;
 
	FOR_ALL_TOWNS(t) if (t->xy != 0) {
 
		t->exclusivity=(byte)-1;
 
	}
 
	
 
	/* FIXME old exclusive rights status is not being imported.
 
	/* FIXME old exclusive rights status is not being imported (stored in s->blocked_months_obsolete)
 
			could be implemented this way:
 
			1.) Go through all stations
 
					Build an array town_blocked[ town_id ][ player_id ]
 
				 that stores if at least one station in that town is blocked for a player
 
			2.) Go through that array, if you find a town that is not blocked for
 
				 	one player, but for all others, then give him exclusivity.
 
	*/
 
}
 

	
 
extern void UpdateOldAircraft();
 

	
 
bool AfterLoadGame(uint version)
0 comments (0 inline, 0 general)