summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-03 21:20:01 +0000
committertron <tron@openttd.org>2005-10-03 21:20:01 +0000
commitdb3b1228bfad7fb42ce708dc93db21d840b07577 (patch)
tree4379525d1560a92903c1fdc87cdbad70a36ea271 /roadveh_cmd.c
parentb0a365ee676b8b612d88a3df1cac904db73e8bcf (diff)
downloadopenttd-db3b1228bfad7fb42ce708dc93db21d840b07577.tar.xz
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 382f1d8da..ee882b25c 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -987,7 +987,7 @@ static int PickRandomBit(uint bits)
num++;
} while (b >>= 1);
- num = ((uint16)Random() * num >> 16);
+ num = GB(Random(), 0, 16) * num >> 16;
for(i=0; !((bits & 1) && ((int)--num) < 0); bits>>=1,i++);
return i;
@@ -1029,8 +1029,8 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir)
{
uint32 r;
r = GetTileTrackStatus(tile, TRANSPORT_ROAD);
- signal = (uint16)(r >> 16);
- bitmask = (uint16)r;
+ signal = GB(r, 16, 16);
+ bitmask = GB(r, 0, 16);
}
if (IsTileType(tile, MP_STREET)) {