summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-02-25 22:04:38 +0000
committeralberth <alberth@openttd.org>2011-02-25 22:04:38 +0000
commit31386c42a7aa51b5b6a7abfc728b9ed4e34df0ea (patch)
tree793449a253b91916b65c373f54b4544a8c6c86b8 /src/ai/api
parent1dbc0a20bed5cd85035b4f84a649c4f7386b07ab (diff)
downloadopenttd-31386c42a7aa51b5b6a7abfc728b9ed4e34df0ea.tar.xz
(svn r22145) -Codechange: Do explicit test for non-bool values.
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_rail.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_rail.cpp b/src/ai/api/ai_rail.cpp
index 0d734f01c..c6aefe714 100644
--- a/src/ai/api/ai_rail.cpp
+++ b/src/ai/api/ai_rail.cpp
@@ -291,7 +291,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
} else {
p2 |= (TRACK_LEFT << 4);
}
- if (diag_offset) {
+ if (diag_offset != 0) {
*to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1);
} else {
*to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1);
@@ -302,7 +302,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
} else {
p2 |= (TRACK_LOWER << 4);
}
- if (diag_offset) {
+ if (diag_offset != 0) {
*to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1);
} else {
*to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1);
@@ -313,7 +313,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
} else {
p2 |= (TRACK_RIGHT << 4);
}
- if (!diag_offset) {
+ if (diag_offset == 0) {
*to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1);
} else {
*to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1);
@@ -324,7 +324,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
} else {
p2 |= (TRACK_LOWER << 4);
}
- if (!diag_offset) {
+ if (diag_offset == 0) {
*to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1);
} else {
*to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1);