src/oldloader.cpp
changeset 8258 9fa31acb07bc
parent 8254 1496654ca5e7
child 8259 3fb6f1f46a4f
equal deleted inserted replaced
8257:3151fdbc73f9 8258:9fa31acb07bc
  1233 			default:   v->spritenum >>= 1; break;
  1233 			default:   v->spritenum >>= 1; break;
  1234 		}
  1234 		}
  1235 
  1235 
  1236 		if (_old_next_ptr != 0xFFFF) v->next = GetVehiclePoolSize() <= _old_next_ptr ? new (_old_next_ptr) InvalidVehicle() : GetVehicle(_old_next_ptr);
  1236 		if (_old_next_ptr != 0xFFFF) v->next = GetVehiclePoolSize() <= _old_next_ptr ? new (_old_next_ptr) InvalidVehicle() : GetVehicle(_old_next_ptr);
  1237 
  1237 
  1238 		v->string_id = RemapOldStringID(_old_string_id);
  1238 		_old_string_id = RemapOldStringID(_old_string_id);
       
  1239 		v->name = CopyFromOldName(_old_string_id);
  1239 
  1240 
  1240 		/* Vehicle-subtype is different in TTD(Patch) */
  1241 		/* Vehicle-subtype is different in TTD(Patch) */
  1241 		if (v->type == VEH_SPECIAL) v->subtype = v->subtype >> 1;
  1242 		if (v->type == VEH_SPECIAL) v->subtype = v->subtype >> 1;
  1242 
  1243 
  1243 		if (_cargo_count != 0) {
  1244 		if (_cargo_count != 0) {
  1249 
  1250 
  1250 	return true;
  1251 	return true;
  1251 }
  1252 }
  1252 
  1253 
  1253 static const OldChunks sign_chunk[] = {
  1254 static const OldChunks sign_chunk[] = {
  1254 	OCL_SVAR( OC_UINT16, Sign, str ),
  1255 	OCL_VAR ( OC_UINT16, 1, &_old_string_id ),
  1255 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, x ),
  1256 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, x ),
  1256 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, y ),
  1257 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, y ),
  1257 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ),
  1258 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ),
  1258 
  1259 
  1259 	OCL_NULL( 6 ),         ///< Width of sign, no longer in use
  1260 	OCL_NULL( 6 ),         ///< Width of sign, no longer in use
  1261 	OCL_END()
  1262 	OCL_END()
  1262 };
  1263 };
  1263 
  1264 
  1264 static bool LoadOldSign(LoadgameState *ls, int num)
  1265 static bool LoadOldSign(LoadgameState *ls, int num)
  1265 {
  1266 {
  1266 	return LoadChunk(ls, new (num) Sign(), sign_chunk);
  1267 	if (!LoadChunk(ls, new (num) Sign(), sign_chunk)) return false;
       
  1268 
       
  1269 	_old_string_id = RemapOldStringID(_old_string_id);
       
  1270 	// XXX copy if custom name$$$
       
  1271 
       
  1272 	return true;
  1267 }
  1273 }
  1268 
  1274 
  1269 static const OldChunks engine_chunk[] = {
  1275 static const OldChunks engine_chunk[] = {
  1270 	OCL_SVAR( OC_UINT16, Engine, player_avail ),
  1276 	OCL_SVAR( OC_UINT16, Engine, player_avail ),
  1271 	OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Engine, intro_date ),
  1277 	OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Engine, intro_date ),