(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.

This commit is contained in:
rubidium
2007-01-10 18:56:51 +00:00
parent a332d10fd9
commit f35ed4bbc2
190 changed files with 2825 additions and 2208 deletions

View File

@@ -276,7 +276,7 @@ static void DisasterTick_UFO(Vehicle *v)
// fly around randomly
int x = TileX(v->dest_tile) * TILE_SIZE;
int y = TileY(v->dest_tile) * TILE_SIZE;
if (abs(x - v->x_pos) + abs(y - v->y_pos) >= TILE_SIZE) {
if (delta(x, v->x_pos) + delta(y, v->y_pos) >= TILE_SIZE) {
v->direction = GetDirectionTowards(v, x, y);
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
@@ -305,7 +305,7 @@ static void DisasterTick_UFO(Vehicle *v)
return;
}
dist = abs(v->x_pos - u->x_pos) + abs(v->y_pos - u->y_pos);
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_ctr = 3;
@@ -526,7 +526,7 @@ static void DisasterTick_4(Vehicle *v)
if (v->current_order.dest == 1) {
int x = TileX(v->dest_tile) * TILE_SIZE + TILE_SIZE / 2;
int y = TileY(v->dest_tile) * TILE_SIZE + TILE_SIZE / 2;
if (abs(v->x_pos - x) + abs(v->y_pos - y) >= 8) {
if (delta(v->x_pos, x) + delta(v->y_pos, y) >= 8) {
v->direction = GetDirectionTowards(v, x, y);
GetNewVehiclePos(v, &gp);
@@ -544,7 +544,7 @@ static void DisasterTick_4(Vehicle *v)
FOR_ALL_VEHICLES(u) {
if (u->type == VEH_Train || u->type == VEH_Road) {
if (abs(u->x_pos - v->x_pos) + abs(u->y_pos - v->y_pos) <= 12 * TILE_SIZE) {
if (delta(u->x_pos, v->x_pos) + delta(u->y_pos, v->y_pos) <= 12 * TILE_SIZE) {
u->breakdown_ctr = 5;
u->breakdown_delay = 0xF0;
}
@@ -578,7 +578,7 @@ static void DisasterTick_4(Vehicle *v)
int x = TileX(v->dest_tile) * TILE_SIZE;
int y = TileY(v->dest_tile) * TILE_SIZE;
if (abs(x - v->x_pos) + abs(y - v->y_pos) >= TILE_SIZE) {
if (delta(x, v->x_pos) + delta(y, v->y_pos) >= TILE_SIZE) {
v->direction = GetDirectionTowards(v, x, y);
GetNewVehiclePos(v, &gp);
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
@@ -626,7 +626,7 @@ static void DisasterTick_4b(Vehicle *v)
if (v->current_order.dest == 0) {
u = GetVehicle(v->u.disaster.unk2);
if (abs(v->x_pos - u->x_pos) > TILE_SIZE)
if (delta(v->x_pos, u->x_pos) > TILE_SIZE)
return;
v->current_order.dest = 1;