|
|
@ -40,6 +40,7 @@
|
|
|
|
#include "vehicle_base.h"
|
|
|
|
#include "vehicle_base.h"
|
|
|
|
#include "sound_func.h"
|
|
|
|
#include "sound_func.h"
|
|
|
|
#include "effectvehicle_func.h"
|
|
|
|
#include "effectvehicle_func.h"
|
|
|
|
|
|
|
|
#include "roadveh.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "table/strings.h"
|
|
|
|
#include "table/strings.h"
|
|
|
|
#include "table/sprites.h"
|
|
|
|
#include "table/sprites.h"
|
|
|
@ -330,7 +331,7 @@ static void DisasterTick_Ufo(Vehicle *v)
|
|
|
|
v->current_order.SetDestination(1);
|
|
|
|
v->current_order.SetDestination(1);
|
|
|
|
|
|
|
|
|
|
|
|
FOR_ALL_VEHICLES(u) {
|
|
|
|
FOR_ALL_VEHICLES(u) {
|
|
|
|
if (u->type == VEH_ROAD && IsHumanPlayer(u->owner)) {
|
|
|
|
if (u->type == VEH_ROAD && IsRoadVehFront(u) && IsHumanPlayer(u->owner)) {
|
|
|
|
v->dest_tile = u->index;
|
|
|
|
v->dest_tile = u->index;
|
|
|
|
v->age = 0;
|
|
|
|
v->age = 0;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -341,7 +342,7 @@ static void DisasterTick_Ufo(Vehicle *v)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
/* Target a vehicle */
|
|
|
|
/* Target a vehicle */
|
|
|
|
u = GetVehicle(v->dest_tile);
|
|
|
|
u = GetVehicle(v->dest_tile);
|
|
|
|
if (u->type != VEH_ROAD) {
|
|
|
|
if (u->type != VEH_ROAD || !IsRoadVehFront(u)) {
|
|
|
|
DeleteDisasterVeh(v);
|
|
|
|
DeleteDisasterVeh(v);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -364,12 +365,16 @@ static void DisasterTick_Ufo(Vehicle *v)
|
|
|
|
v->age++;
|
|
|
|
v->age++;
|
|
|
|
if (u->u.road.crashed_ctr == 0) {
|
|
|
|
if (u->u.road.crashed_ctr == 0) {
|
|
|
|
u->u.road.crashed_ctr++;
|
|
|
|
u->u.road.crashed_ctr++;
|
|
|
|
u->vehstatus |= VS_CRASHED;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AddNewsItem(STR_B001_ROAD_VEHICLE_DESTROYED,
|
|
|
|
AddNewsItem(STR_B001_ROAD_VEHICLE_DESTROYED,
|
|
|
|
NS_ACCIDENT_VEHICLE,
|
|
|
|
NS_ACCIDENT_VEHICLE,
|
|
|
|
u->index,
|
|
|
|
u->index,
|
|
|
|
0);
|
|
|
|
0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Vehicle *w = u; w != NULL; w = w->Next()) {
|
|
|
|
|
|
|
|
w->vehstatus |= VS_CRASHED;
|
|
|
|
|
|
|
|
MarkSingleVehicleDirty(w);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|