From 524fd25cbd2b32fd8166e196c5eab1f2f7e82a8a Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 14 Nov 2005 08:09:57 +0000 Subject: (svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT --- train_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'train_cmd.c') diff --git a/train_cmd.c b/train_cmd.c index aed2c8ea8..3f2667ac2 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -1623,10 +1623,10 @@ int32 CmdForceTrainProceed(int x, int y, uint32 flags, uint32 p1, uint32 p2) */ int32 CmdRefitRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2) { + CargoID new_cid = GB(p2, 0, 8); Vehicle *v; int32 cost; uint num; - CargoID new_cid = p2 & 0xFF; //gets the cargo number if (!IsVehicleIndex(p1)) return CMD_ERROR; @@ -3173,7 +3173,7 @@ static void ChangeTrainDirRandomly(Vehicle *v) do { //I need to buffer the train direction if (!(v->u.rail.track & 0x40)) - v->direction = (v->direction + _random_dir_change[Random()&3]) & 7; + v->direction = (v->direction + _random_dir_change[GB(Random(), 0, 2)]) & 7; if (!(v->vehstatus & VS_HIDDEN)) { BeginVehicleMove(v); UpdateTrainDeltaXY(v, v->direction); -- cgit v1.2.3-54-g00ecf