|
@@ -26,13 +26,12 @@ static void ChimneySmokeTick(Vehicle *v)
|
|
|
v->progress--;
|
|
|
} else {
|
|
|
BeginVehicleMove(v);
|
|
|
|
|
|
TileIndex tile = TileVirtXY(v->x_pos, v->y_pos);
|
|
|
if (!IsTileType(tile, MP_INDUSTRY)) {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (v->cur_image != SPR_CHIMNEY_SMOKE_7) {
|
|
|
v->cur_image++;
|
|
@@ -65,13 +64,12 @@ static void SteamSmokeTick(Vehicle *v)
|
|
|
}
|
|
|
|
|
|
if ((v->progress & 0xF) == 4) {
|
|
|
if (v->cur_image != SPR_STEAM_SMOKE_4) {
|
|
|
v->cur_image++;
|
|
|
} else {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
return;
|
|
|
}
|
|
|
moved = true;
|
|
|
}
|
|
|
|
|
@@ -100,13 +98,12 @@ static void DieselSmokeTick(Vehicle *v)
|
|
|
BeginVehicleMove(v);
|
|
|
if (v->cur_image != SPR_DIESEL_SMOKE_5) {
|
|
|
v->cur_image++;
|
|
|
VehiclePositionChanged(v);
|
|
|
EndVehicleMove(v);
|
|
|
} else {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void ElectricSparkInit(Vehicle *v)
|
|
@@ -124,13 +121,12 @@ static void ElectricSparkTick(Vehicle *v
|
|
|
BeginVehicleMove(v);
|
|
|
if (v->cur_image != SPR_ELECTRIC_SPARK_5) {
|
|
|
v->cur_image++;
|
|
|
VehiclePositionChanged(v);
|
|
|
EndVehicleMove(v);
|
|
|
} else {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void SmokeInit(Vehicle *v)
|
|
@@ -153,13 +149,12 @@ static void SmokeTick(Vehicle *v)
|
|
|
}
|
|
|
|
|
|
if ((v->progress & 0xF) == 4) {
|
|
|
if (v->cur_image != SPR_SMOKE_4) {
|
|
|
v->cur_image++;
|
|
|
} else {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
return;
|
|
|
}
|
|
|
moved = true;
|
|
|
}
|
|
|
|
|
@@ -182,13 +177,12 @@ static void ExplosionLargeTick(Vehicle *
|
|
|
BeginVehicleMove(v);
|
|
|
if (v->cur_image != SPR_EXPLOSION_LARGE_F) {
|
|
|
v->cur_image++;
|
|
|
VehiclePositionChanged(v);
|
|
|
EndVehicleMove(v);
|
|
|
} else {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void BreakdownSmokeInit(Vehicle *v)
|
|
@@ -210,14 +204,12 @@ static void BreakdownSmokeTick(Vehicle *
|
|
|
VehiclePositionChanged(v);
|
|
|
EndVehicleMove(v);
|
|
|
}
|
|
|
|
|
|
v->u.effect.animation_state--;
|
|
|
if (v->u.effect.animation_state == 0) {
|
|
|
BeginVehicleMove(v);
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void ExplosionSmallInit(Vehicle *v)
|
|
|
{
|
|
@@ -232,13 +224,12 @@ static void ExplosionSmallTick(Vehicle *
|
|
|
BeginVehicleMove(v);
|
|
|
if (v->cur_image != SPR_EXPLOSION_SMALL_B) {
|
|
|
v->cur_image++;
|
|
|
VehiclePositionChanged(v);
|
|
|
EndVehicleMove(v);
|
|
|
} else {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void BulldozerInit(Vehicle *v)
|
|
@@ -303,13 +294,12 @@ static void BulldozerTick(Vehicle *v)
|
|
|
|
|
|
v->u.effect.animation_substate++;
|
|
|
if (v->u.effect.animation_substate >= b->duration) {
|
|
|
v->u.effect.animation_substate = 0;
|
|
|
v->u.effect.animation_state++;
|
|
|
if (v->u.effect.animation_state == lengthof(_bulldozer_movement)) {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
VehiclePositionChanged(v);
|
|
|
EndVehicleMove(v);
|
|
@@ -499,13 +489,12 @@ static void BubbleTick(Vehicle *v)
|
|
|
anim_state = v->u.effect.animation_state + 1;
|
|
|
}
|
|
|
|
|
|
const BubbleMovement *b = &_bubble_movement[v->spritenum - 1][anim_state];
|
|
|
|
|
|
if (b->y == 4 && b->x == 0) {
|
|
|
EndVehicleMove(v);
|
|
|
delete v;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (b->y == 4 && b->x == 1) {
|
|
|
if (v->z_pos > 180 || Chance16I(1, 96, Random())) {
|