From 01ae38e3d7555b9753e980f55c94bb20a9512ed7 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 21 Apr 2007 07:17:14 +0000 Subject: (svn r9706) -Codechange: Support NewGRF town var 40 'largertowns' variable properly. --- src/newgrf_town.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/newgrf_town.cpp b/src/newgrf_town.cpp index 497684e59..149427908 100644 --- a/src/newgrf_town.cpp +++ b/src/newgrf_town.cpp @@ -4,6 +4,7 @@ #include "stdafx.h" #include "openttd.h" +#include "variables.h" #include "debug.h" #include "functions.h" #include "town.h" @@ -18,7 +19,10 @@ uint32 TownGetVariable(byte variable, byte parameter, bool *available, const Tow { switch (variable) { /* Larger towns */ - case 0x40: return 1; + case 0x40: + if (_patches.larger_towns == 0) return 2; + if (t->index % _patches.larger_towns == 0) return 1; + return 0; /* Town index */ case 0x41: return t->index; -- cgit v1.2.3-70-g09d2