diff options
author | frosch <frosch@openttd.org> | 2008-02-25 13:38:11 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-02-25 13:38:11 +0000 |
commit | e464cbcfd6b81a0888f2245ab791e0e8c6595e2d (patch) | |
tree | a993e5d8895dbe0886c69bf9b5430ec5f2748282 | |
parent | de8c95506b43e78b405615a9185825fa54c0d380 (diff) | |
download | openttd-e464cbcfd6b81a0888f2245ab791e0e8c6595e2d.tar.xz |
(svn r12246) -Fix (r10460): Proper usage of Clamp().
-rw-r--r-- | src/newgrf_industries.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index 8eb6eb951..ceb705e8a 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -352,14 +352,14 @@ uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte par case 0xA6: return industry->type; case 0xA7: return industry->founder; case 0xA8: return industry->random_color; - case 0xA9: return Clamp(0, industry->last_prod_year - ORIGINAL_BASE_YEAR, 255); + case 0xA9: return Clamp(industry->last_prod_year - ORIGINAL_BASE_YEAR, 0, 255); case 0xAA: return industry->counter; case 0xAB: return GB(industry->counter, 8, 8); case 0xAC: return industry->was_cargo_delivered; - case 0xB0: return Clamp(0, industry->construction_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 65535); // Date when built since 1920 (in days) + case 0xB0: return Clamp(industry->construction_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); // Date when built since 1920 (in days) case 0xB3: return industry->construction_type; // Construction type - case 0xB4: return Clamp(0, industry->last_cargo_accepted_at - DAYS_TILL_ORIGINAL_BASE_YEAR, 65535); // Date last cargo accepted since 1920 (in days) + case 0xB4: return Clamp(industry->last_cargo_accepted_at - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); // Date last cargo accepted since 1920 (in days) } DEBUG(grf, 1, "Unhandled industry property 0x%X", variable); |