summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-01-24 14:39:22 +0000
committercelestar <celestar@openttd.org>2005-01-24 14:39:22 +0000
commit3bd60674b89e7396f445289bfc9ce3e7f093df53 (patch)
tree178c91703cd659d949c3eb86322748cdb6eb0000
parentf91558f4c633f1b377d4c2a683bd9bf661e8a43c (diff)
downloadopenttd-3bd60674b89e7396f445289bfc9ce3e7f093df53.tar.xz
(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.
-rw-r--r--train_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 81f85e9ae..8a65b108f 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2361,7 +2361,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[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 *v)
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),