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

« back to all changes in this revision

Viewing changes to src/ai/api/ai_industry.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Kooijman, Matthijs Kooijman
  • Date: 2009-10-01 22:52:59 UTC
  • mfrom: (1.1.8 upstream) (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091001225259-5kpkp4sthbszpyif
[ Matthijs Kooijman ]
* New upstream release
* Use printf instead of echo -en in openttd-wrapper to make it POSIX
  compatible (Closes: #547758).
* Remove three patches that are now included in upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: ai_industry.cpp 15563 2009-02-23 21:07:01Z yexo $ */
 
1
/* $Id: ai_industry.cpp 17305 2009-08-29 11:18:03Z smatz $ */
2
2
 
3
3
/** @file ai_industry.cpp Implementation of AIIndustry. */
4
4
 
91
91
        return -1;
92
92
}
93
93
 
 
94
/* static */ int32 AIIndustry::GetLastMonthTransportedPercentage(IndustryID industry_id, CargoID cargo_id)
 
95
{
 
96
        if (!IsValidIndustry(industry_id)) return -1;
 
97
        if (!AICargo::IsValidCargo(cargo_id)) return -1;
 
98
 
 
99
        const Industry *i = ::GetIndustry(industry_id);
 
100
 
 
101
        for (byte j = 0; j < lengthof(i->produced_cargo); j++) {
 
102
                if (i->produced_cargo[j] == cargo_id) return i->last_month_pct_transported[j] * 100 >> 8;
 
103
        }
 
104
 
 
105
        return -1;
 
106
}
 
107
 
94
108
/* static */ TileIndex AIIndustry::GetLocation(IndustryID industry_id)
95
109
{
96
110
        if (!IsValidIndustry(industry_id)) return INVALID_TILE;