src/newgrf_town.cpp
branchNewGRF_ports
changeset 6719 4cc327ad39d5
parent 6658 59048224be55
child 6720 35756db7e577
equal deleted inserted replaced
6718:5a8b295aa345 6719:4cc327ad39d5
     2 
     2 
     3 /** @file newgrf_town.cpp */
     3 /** @file newgrf_town.cpp */
     4 
     4 
     5 #include "stdafx.h"
     5 #include "stdafx.h"
     6 #include "openttd.h"
     6 #include "openttd.h"
       
     7 #include "variables.h"
     7 #include "debug.h"
     8 #include "debug.h"
     8 #include "functions.h"
     9 #include "functions.h"
     9 #include "town.h"
    10 #include "town.h"
    10 
    11 
    11 /** This function implements the town variables that newGRF defines.
    12 /** This function implements the town variables that newGRF defines.
    16  * @return the value stored in the corresponding variable*/
    17  * @return the value stored in the corresponding variable*/
    17 uint32 TownGetVariable(byte variable, byte parameter, bool *available, const Town *t)
    18 uint32 TownGetVariable(byte variable, byte parameter, bool *available, const Town *t)
    18 {
    19 {
    19 	switch (variable) {
    20 	switch (variable) {
    20 		/* Larger towns */
    21 		/* Larger towns */
    21 		case 0x40: return 1;
    22 		case 0x40:
       
    23 			if (_patches.larger_towns == 0) return 2;
       
    24 			if (t->larger_town) return 1;
       
    25 			return 0;
    22 
    26 
    23 		/* Town index */
    27 		/* Town index */
    24 		case 0x41: return t->index;
    28 		case 0x41: return t->index;
    25 
    29 
    26 		/* Town properties */
    30 		/* Town properties */