74 |
74 |
75 // NOSAVE: for wagon override - id of the first engine in train |
75 // NOSAVE: for wagon override - id of the first engine in train |
76 // 0xffff == not in train |
76 // 0xffff == not in train |
77 EngineID first_engine; |
77 EngineID first_engine; |
78 |
78 |
79 byte track; |
79 TrackBitsByte track; |
80 byte force_proceed; |
80 byte force_proceed; |
81 byte railtype; |
81 RailTypeByte railtype; |
82 RailTypeMask compatible_railtypes; |
82 RailTypeMask compatible_railtypes; |
83 |
83 |
84 byte flags; |
84 byte flags; |
85 |
85 |
86 // Link between the two ends of a multiheaded engine |
86 // Link between the two ends of a multiheaded engine |
136 uint16 image_override; |
136 uint16 image_override; |
137 uint16 unk2; |
137 uint16 unk2; |
138 } VehicleDisaster; |
138 } VehicleDisaster; |
139 |
139 |
140 typedef struct VehicleShip { |
140 typedef struct VehicleShip { |
141 byte state; |
141 TrackBitsByte state; |
142 } VehicleShip; |
142 } VehicleShip; |
143 |
143 |
144 |
144 |
145 struct Vehicle { |
145 struct Vehicle { |
146 byte type; // type, ie roadven,train,ship,aircraft,special |
146 byte type; // type, ie roadven,train,ship,aircraft,special |
153 Vehicle *depot_list; //NOSAVE: linked list to tell what vehicles entered a depot during the last tick. Used by autoreplace |
153 Vehicle *depot_list; //NOSAVE: linked list to tell what vehicles entered a depot during the last tick. Used by autoreplace |
154 |
154 |
155 StringID string_id; // Displayed string |
155 StringID string_id; // Displayed string |
156 |
156 |
157 UnitID unitnumber; // unit number, for display purposes only |
157 UnitID unitnumber; // unit number, for display purposes only |
158 PlayerID owner; // which player owns the vehicle? |
158 PlayerByte owner; // which player owns the vehicle? |
159 |
159 |
160 TileIndex tile; // Current tile index |
160 TileIndex tile; // Current tile index |
161 TileIndex dest_tile; // Heading for this tile |
161 TileIndex dest_tile; // Heading for this tile |
162 |
162 |
163 int32 x_pos; // coordinates |
163 int32 x_pos; // coordinates |
164 int32 y_pos; |
164 int32 y_pos; |
165 byte z_pos; |
165 byte z_pos; |
166 byte direction; // facing |
166 DirectionByte direction; // facing |
167 |
167 |
168 byte spritenum; // currently displayed sprite index |
168 byte spritenum; // currently displayed sprite index |
169 // 0xfd == custom sprite, 0xfe == custom second head sprite |
169 // 0xfd == custom sprite, 0xfe == custom second head sprite |
170 // 0xff == reserved for another custom sprite |
170 // 0xff == reserved for another custom sprite |
171 uint16 cur_image; // sprite number for this vehicle |
171 uint16 cur_image; // sprite number for this vehicle |
453 |
453 |
454 // NOSAVE: Return values from various commands. |
454 // NOSAVE: Return values from various commands. |
455 VARDEF VehicleID _new_vehicle_id; |
455 VARDEF VehicleID _new_vehicle_id; |
456 VARDEF uint16 _returned_refit_capacity; |
456 VARDEF uint16 _returned_refit_capacity; |
457 |
457 |
458 enum { |
458 static const VehicleID INVALID_VEHICLE = 0xFFFF; |
459 INVALID_VEHICLE = 0xFFFF, |
|
460 }; |
|
461 |
459 |
462 /** |
460 /** |
463 * Get the colour map for an engine. This used for unbuilt engines in the user interface. |
461 * Get the colour map for an engine. This used for unbuilt engines in the user interface. |
464 * @param engine_type ID of engine |
462 * @param engine_type ID of engine |
465 * @param player ID of player |
463 * @param player ID of player |