# HG changeset patch # User celestar # Date 2005-01-24 14:39:22 # Node ID 73b91a0f80ab2c7b1c5e5e2f2a54c84eb08d90a1 # Parent d873c69e766537ec0f791d1b17c93948862f2812 (svn r1638) -Fix: Train crashes should no longer desync the game. This is more of a workaround, as somewhere there might be some InteractiveRandom() abuse in the code. diff --git a/train_cmd.c b/train_cmd.c --- a/train_cmd.c +++ b/train_cmd.c @@ -2361,7 +2361,7 @@ static void ChangeTrainDirRandomly(Vehic do { //I need to buffer the train direction if (!(v->u.rail.track & 0x40)) - v->direction = (v->direction + _random_dir_change[InteractiveRandom()&3]) & 7; + v->direction = (v->direction + _random_dir_change[Random()&3]) & 7; if (!(v->vehstatus & VS_HIDDEN)) { BeginVehicleMove(v); UpdateTrainDeltaXY(v, v->direction); @@ -2381,13 +2381,13 @@ static void HandleCrashedTrain(Vehicle * CreateEffectVehicleRel(v, 4, 4, 8, EV_CRASHED_SMOKE); } - if (state <= 200 && (uint16)(r=InteractiveRandom()) <= 0x2492) { + if (state <= 200 && (uint16)(r=Random()) <= 0x2492) { index = (r * 10 >> 16); u = v; do { if (--index < 0) { - r = InteractiveRandom(); + r = Random(); CreateEffectVehicleRel(u, 2 + ((r>>8)&7),