@@ -330,49 +330,53 @@ static bool RailVehicleChangeInfo(uint e
}
} break;
case 0x1D: { /* Refit cargo */
FOR_EACH_OBJECT {
uint32 refit_mask = grf_load_dword(&buf);
_engine_refit_masks[engine + i] = refit_mask;
/* TODO */
/* Fall-through for unimplemented two bytes long properties. */
case 0x1B: /* Powered wagons power bonus */
grf_load_byte(&buf);
/* Fall-through for unimplemented one byte long properties. */
case 0x1A: /* Sort order */
case 0x1C: /* Refit cost */
case 0x1E: /* Callback */
case 0x1F: /* Tractive effort */
case 0x20: /* Air drag */
case 0x21: /* Shorter tenders */
case 0x22: /* Visual */
case 0x23: {/* Powered wagons weight bonus */
case 0x23: /* Powered wagons weight bonus */
case 0x24: /* High byte of vehicle weight */
case 0x25: /* User-defined bit mask to set when checking veh. var. 42 */
case 0x26: /* Retire vehicle early */
{
ret = true;
default:
*bufp = buf;
return ret;
static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **bufp, int len)
RoadVehicleInfo *rvi = &_road_vehicle_info[engine];
byte *buf = *bufp;
int i;
bool ret = false;
switch (prop) {
case 0x08: { /* Speed */
uint8 speed = grf_load_byte(&buf);
@@ -436,48 +440,52 @@ static bool RoadVehicleChangeInfo(uint e
rvi[i].sfx = sfx;
case 0x13: /* Power in 10hp */
case 0x14: /* Weight in 1/4 tons */
case 0x15: /* Speed in mph*0.8 */
/* TODO: Support for road vehicles realistic power
* computations (called rvpower in TTDPatch) is just
* missing in OTTD yet. --pasky */
break;
case 0x16: { /* Cargos available for refitting */
_engine_refit_masks[ROAD_ENGINES_INDEX + engine + i] = refit_mask;
case 0x17: /* Callback */
case 0x18: /* Tractive effort */
case 0x19: /* Air drag */
case 0x1A: /* Refit cost */
case 0x1B: /* Retire vehicle early */
static bool ShipVehicleChangeInfo(uint engine, int numinfo, int prop, byte **bufp, int len)
ShipVehicleInfo *svi = &_ship_vehicle_info[engine];
//printf("e %x prop %x?\n", engine, prop);
case 0x08: { /* Sprite ID */
@@ -537,49 +545,58 @@ static bool ShipVehicleChangeInfo(uint e
svi[i].capacity = capacity;
case 0x0F: { /* Running cost factor */
uint8 runcost = grf_load_byte(&buf);
svi[i].running_cost = runcost;
case 0x10: { /* SFX */
uint8 sfx = grf_load_byte(&buf);
svi[i].sfx = sfx;
case 0x11: { /* Cargos available for refitting */
_engine_refit_masks[SHIP_ENGINES_INDEX + engine + i] = refit_mask;
case 0x12: { /* Callback TODO */
case 0x12: /* Callback */
case 0x13: /* Refit cost */
case 0x14: /* Ocean speed fraction */
case 0x15: /* Canal speed fraction */
case 0x16: /* Retire vehicle early */
static bool AircraftVehicleChangeInfo(uint engine, int numinfo, int prop, byte **bufp, int len)
AircraftVehicleInfo *avi = &_aircraft_vehicle_info[engine];
uint8 spriteid = grf_load_byte(&buf);
if (spriteid == 0xFF)
@@ -642,49 +659,56 @@ static bool AircraftVehicleChangeInfo(ui
avi[i].passenger_capacity = capacity;
case 0x11: { /* Mail capacity */
uint8 capacity = grf_load_byte(&buf);
avi[i].mail_capacity = capacity;
case 0x12: { /* SFX */
avi[i].sfx = sfx;
case 0x13: { /* Cargos available for refitting */
_engine_refit_masks[AIRCRAFT_ENGINES_INDEX + engine + i] = refit_mask;
case 0x14: { /* Callback TODO */
case 0x14: /* Callback */
case 0x15: /* Refit cost */
static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int len)
int ret = 0;
/* This is one single huge TODO. It doesn't handle anything more than
* just waypoints for now. */
//printf("sci %d %d [0x%02x]\n", stid, numinfo, prop);
case 0x08:
{ /* Class ID */
Status change: