~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/newgrf_house.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Kooijman
  • Date: 2008-08-08 11:07:05 UTC
  • mfrom: (1.1.4 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080808110705-zq0eo95c4pexg70i
* New upstream release.
  - Fixes remote crash vulnerability CVE-2008-3547. Closes: #493714

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: newgrf_house.cpp 12871 2008-04-24 14:33:18Z rubidium $ */
 
1
/* $Id: newgrf_house.cpp 13735 2008-07-19 12:23:14Z rubidium $ */
2
2
 
3
3
/** @file newgrf_house.cpp */
4
4
 
30
30
static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
31
31
 
32
32
HouseOverrideManager _house_mngr(NEW_HOUSE_OFFSET, HOUSE_MAX, INVALID_HOUSE_ID);
 
33
extern TileIndex GetHouseNorthPart(HouseID &house);
33
34
 
34
35
/**
35
36
 * Check and update town and house values.
67
68
                IncreaseBuildingCount(town, house_id);
68
69
                if (IsHouseCompleted(t)) town->population += GetHouseSpecs(house_id)->population;
69
70
 
70
 
                /* Increase the number of houses for every house tile which
71
 
                 * has a size bit set. Multi tile buildings have got only
72
 
                 * one tile with such a bit set, so there is no problem. */
73
 
                if (GetHouseSpecs(GetHouseType(t))->building_flags & BUILDING_HAS_1_TILE) {
74
 
                        town->num_houses++;
75
 
                }
 
71
                /* Increase the number of houses for every house, but only once. */
 
72
                if (GetHouseNorthPart(house_id) == 0) town->num_houses++;
76
73
        }
77
74
 
78
75
        /* Update the population and num_house dependant values */