File diff r26193:4bc7915a2156 → r26194:f7347205838e
src/disaster_vehicle.cpp
Show inline comments
 
@@ -359,12 +359,13 @@ static bool DisasterTick_Ufo(DisasterVeh
 
		RoadVehicle *u = RoadVehicle::Get(v->dest_tile);
 
		assert(u != nullptr && u->type == VEH_ROAD && u->IsFrontEngine());
 

	
 
		uint dist = Delta(v->x_pos, u->x_pos) + Delta(v->y_pos, u->y_pos);
 

	
 
		if (dist < TILE_SIZE && !(u->vehstatus & VS_HIDDEN) && u->breakdown_ctr == 0) {
 
			u->breakdown_type = BREAKDOWN_CRITICAL;
 
			u->breakdown_ctr = 3;
 
			u->breakdown_delay = 140;
 
		}
 

	
 
		v->direction = GetDirectionTowards(v, u->x_pos, u->y_pos);
 
		GetNewVehiclePosResult gp = GetNewVehiclePos(v);
 
@@ -544,12 +545,13 @@ static bool DisasterTick_Big_Ufo(Disaste
 

	
 
		for (Vehicle *target : Vehicle::Iterate()) {
 
			if (target->IsGroundVehicle()) {
 
				if (Delta(target->x_pos, v->x_pos) + Delta(target->y_pos, v->y_pos) <= 12 * (int)TILE_SIZE) {
 
					target->breakdown_ctr = 5;
 
					target->breakdown_delay = 0xF0;
 
					target->breakdown_type = BREAKDOWN_CRITICAL;
 
				}
 
			}
 
		}
 

	
 
		Town *t = ClosestTownFromTile(v->dest_tile, UINT_MAX);
 
		SetDParam(0, t->index);