(svn r9706) -Codechange: Support NewGRF town var 40 'largertowns' variable properly.
authorpeter1138
Sat, 21 Apr 2007 07:17:14 +0000
changeset 6520 978e8f5c009b
parent 6519 3207d8852fb9
child 6521 d4d0e886f4bd
(svn r9706) -Codechange: Support NewGRF town var 40 'largertowns' variable properly.
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;