|
@@ -148,24 +148,24 @@ static void InitializeDisasterVehicle(Di
|
|
|
v->owner = OWNER_NONE;
|
|
|
v->vehstatus = VS_UNCLICKABLE;
|
|
|
v->image_override = 0;
|
|
|
v->current_order.Free();
|
|
|
|
|
|
DisasterVehicleUpdateImage(v);
|
|
|
VehicleUpdatePositionAndViewport(v);
|
|
|
v->UpdatePositionAndViewport();
|
|
|
}
|
|
|
|
|
|
static void SetDisasterVehiclePos(DisasterVehicle *v, int x, int y, int z)
|
|
|
{
|
|
|
v->x_pos = x;
|
|
|
v->y_pos = y;
|
|
|
v->z_pos = z;
|
|
|
v->tile = TileVirtXY(x, y);
|
|
|
|
|
|
DisasterVehicleUpdateImage(v);
|
|
|
VehicleUpdatePositionAndViewport(v);
|
|
|
v->UpdatePositionAndViewport();
|
|
|
|
|
|
DisasterVehicle *u = v->Next();
|
|
|
if (u != NULL) {
|
|
|
int safe_x = Clamp(x, 0, MapMaxX() * TILE_SIZE);
|
|
|
int safe_y = Clamp(y - 1, 0, MapMaxY() * TILE_SIZE);
|
|
|
|
|
@@ -173,19 +173,19 @@ static void SetDisasterVehiclePos(Disast
|
|
|
u->y_pos = y - 1 - (max(z - GetSlopePixelZ(safe_x, safe_y), 0) >> 3);
|
|
|
safe_y = Clamp(u->y_pos, 0, MapMaxY() * TILE_SIZE);
|
|
|
u->z_pos = GetSlopePixelZ(safe_x, safe_y);
|
|
|
u->direction = v->direction;
|
|
|
|
|
|
DisasterVehicleUpdateImage(u);
|
|
|
VehicleUpdatePositionAndViewport(u);
|
|
|
u->UpdatePositionAndViewport();
|
|
|
|
|
|
if ((u = u->Next()) != NULL) {
|
|
|
u->x_pos = x;
|
|
|
u->y_pos = y;
|
|
|
u->z_pos = z + 5;
|
|
|
VehicleUpdatePositionAndViewport(u);
|
|
|
u->UpdatePositionAndViewport();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Zeppeliner handling, v->current_order.dest states:
|
|
@@ -473,13 +473,13 @@ static bool DisasterTick_Helicopter_Roto
|
|
|
{
|
|
|
v->tick_counter++;
|
|
|
if (HasBit(v->tick_counter, 0)) return true;
|
|
|
|
|
|
if (++v->cur_image > SPR_ROTOR_MOVING_3) v->cur_image = SPR_ROTOR_MOVING_1;
|
|
|
|
|
|
VehicleUpdatePositionAndViewport(v);
|
|
|
v->UpdatePositionAndViewport();
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* (Big) Ufo handling, v->current_order.dest states:
|