114 SpriteID img = v->u.disaster.image_override; |
114 SpriteID img = v->u.disaster.image_override; |
115 if (img == 0) img = _disaster_images[v->subtype][v->direction]; |
115 if (img == 0) img = _disaster_images[v->subtype][v->direction]; |
116 v->cur_image = img; |
116 v->cur_image = img; |
117 } |
117 } |
118 |
118 |
119 |
|
120 /** Initialize a disaster vehicle. These vehicles are of type VEH_DISASTER, are unclickable |
119 /** Initialize a disaster vehicle. These vehicles are of type VEH_DISASTER, are unclickable |
121 * and owned by nobody */ |
120 * and owned by nobody */ |
122 static void InitializeDisasterVehicle(Vehicle *v, int x, int y, byte z, Direction direction, byte subtype) |
121 static void InitializeDisasterVehicle(Vehicle *v, int x, int y, byte z, Direction direction, byte subtype) |
123 { |
122 { |
124 v->type = VEH_DISASTER; |
123 v = new (v) DisasterVehicle(); |
125 v->x_pos = x; |
124 v->x_pos = x; |
126 v->y_pos = y; |
125 v->y_pos = y; |
127 v->z_pos = z; |
126 v->z_pos = z; |
128 v->tile = TileVirtXY(x, y); |
127 v->tile = TileVirtXY(x, y); |
129 v->direction = direction; |
128 v->direction = direction; |
130 v->subtype = subtype; |
129 v->subtype = subtype; |
131 v->x_offs = -1; |
130 v->UpdateDeltaXY(INVALID_DIR); |
132 v->y_offs = -1; |
|
133 v->sprite_width = 2; |
|
134 v->sprite_height = 2; |
|
135 v->z_height = 5; |
|
136 v->owner = OWNER_NONE; |
131 v->owner = OWNER_NONE; |
137 v->vehstatus = VS_UNCLICKABLE; |
132 v->vehstatus = VS_UNCLICKABLE; |
138 v->u.disaster.image_override = 0; |
133 v->u.disaster.image_override = 0; |
139 v->current_order.Free(); |
134 v->current_order.Free(); |
140 |
135 |