# HG changeset patch # User peter1138 # Date 1177139834 0 # Node ID 978e8f5c009bec3fcac106002a621c06c6ccda18 # Parent 3207d8852fb9dcddd1d10af3357954b258765860 (svn r9706) -Codechange: Support NewGRF town var 40 'largertowns' variable properly. diff -r 3207d8852fb9 -r 978e8f5c009b src/newgrf_town.cpp --- a/src/newgrf_town.cpp Sat Apr 21 02:47:33 2007 +0000 +++ b/src/newgrf_town.cpp Sat Apr 21 07:17:14 2007 +0000 @@ -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 @@ { 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;