From f9709a6f50044683e6c165ca9104c5e68a9bd905 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 25 Feb 2010 09:43:00 +0000 Subject: (svn r19235) -Add: [NewGRF] Add 2 bits of pseudo-random data for rail types, based on tile location. --- src/newgrf_railtype.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp index b76eb2aef..931f544e9 100644 --- a/src/newgrf_railtype.cpp +++ b/src/newgrf_railtype.cpp @@ -14,10 +14,13 @@ #include "newgrf_commons.h" #include "newgrf_railtype.h" #include "newgrf_spritegroup.h" +#include "core/bitmath_func.hpp" static uint32 RailTypeGetRandomBits(const ResolverObject *object) { - return 0; + TileIndex tile = object->u.routes.tile; + uint tmp = CountBits(tile + (TileX(tile) + TileY(tile)) * TILE_SIZE); + return GB(tmp, 0, 2); } static uint32 RailTypeGetTriggers(const ResolverObject *object) -- cgit v1.2.3-70-g09d2