mirror of https://github.com/OpenTTD/OpenTTD
(svn r22556) -Codechange: Remove constness from the town pointer at industries.
parent
f12e71e1be
commit
d7ec492887
|
@ -41,7 +41,7 @@ struct Industry : IndustryPool::PoolItem<&_industry_pool> {
|
||||||
typedef PersistentStorageArray<int32, 16> PersistentStorage;
|
typedef PersistentStorageArray<int32, 16> PersistentStorage;
|
||||||
|
|
||||||
TileArea location; ///< Location of the industry
|
TileArea location; ///< Location of the industry
|
||||||
const Town *town; ///< Nearest town
|
Town *town; ///< Nearest town
|
||||||
CargoID produced_cargo[2]; ///< 2 production cargo slots
|
CargoID produced_cargo[2]; ///< 2 production cargo slots
|
||||||
uint16 produced_cargo_waiting[2]; ///< amount of cargo produced per cargo
|
uint16 produced_cargo_waiting[2]; ///< amount of cargo produced per cargo
|
||||||
uint16 incoming_cargo_waiting[3]; ///< incoming cargo waiting to be processed
|
uint16 incoming_cargo_waiting[3]; ///< incoming cargo waiting to be processed
|
||||||
|
|
|
@ -1271,7 +1271,7 @@ static CheckNewIndustryProc * const _check_new_industry_procs[CHECK_END] = {
|
||||||
* @precond \c *t != NULL
|
* @precond \c *t != NULL
|
||||||
* @postcon \c *t points to a town on success, and \c NULL on failure.
|
* @postcon \c *t points to a town on success, and \c NULL on failure.
|
||||||
*/
|
*/
|
||||||
static CommandCost FindTownForIndustry(TileIndex tile, int type, const Town **t)
|
static CommandCost FindTownForIndustry(TileIndex tile, int type, Town **t)
|
||||||
{
|
{
|
||||||
*t = ClosestTownFromTile(tile, UINT_MAX);
|
*t = ClosestTownFromTile(tile, UINT_MAX);
|
||||||
|
|
||||||
|
@ -1540,7 +1540,7 @@ static CommandCost CheckIfFarEnoughFromConflictingIndustry(TileIndex tile, int t
|
||||||
* @param founder Founder of the industry; OWNER_NONE in case of random construction.
|
* @param founder Founder of the industry; OWNER_NONE in case of random construction.
|
||||||
* @param initial_random_bits Random bits for the industry.
|
* @param initial_random_bits Random bits for the industry.
|
||||||
*/
|
*/
|
||||||
static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, const IndustryTileTable *it, byte layout, const Town *t, Owner founder, uint16 initial_random_bits)
|
static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, const IndustryTileTable *it, byte layout, Town *t, Owner founder, uint16 initial_random_bits)
|
||||||
{
|
{
|
||||||
const IndustrySpec *indspec = GetIndustrySpec(type);
|
const IndustrySpec *indspec = GetIndustrySpec(type);
|
||||||
|
|
||||||
|
@ -1704,7 +1704,7 @@ static CommandCost CreateNewIndustryHelper(TileIndex tile, IndustryType type, Do
|
||||||
ret = CheckIfFarEnoughFromConflictingIndustry(tile, type);
|
ret = CheckIfFarEnoughFromConflictingIndustry(tile, type);
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
|
|
||||||
const Town *t = NULL;
|
Town *t = NULL;
|
||||||
ret = FindTownForIndustry(tile, type, &t);
|
ret = FindTownForIndustry(tile, type, &t);
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
assert(t != NULL);
|
assert(t != NULL);
|
||||||
|
|
Loading…
Reference in New Issue