diff options
author | tron <tron@openttd.org> | 2005-10-23 13:04:44 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-10-23 13:04:44 +0000 |
commit | 47137cefb72d3b3d3bc6fdefc7a4b103429f6d46 (patch) | |
tree | 7a8d1fbbe0d0d6ee2c8e981c57be6a9003505e97 /town_cmd.c | |
parent | 2cc2154ad26b96b032df2f4fca0ce1634e6330b2 (diff) | |
download | openttd-47137cefb72d3b3d3bc6fdefc7a4b103429f6d46.tar.xz |
(svn r3078) Some more stuff, which piled up:
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
Diffstat (limited to 'town_cmd.c')
-rw-r--r-- | town_cmd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/town_cmd.c b/town_cmd.c index b265057c0..3894164b2 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -1657,9 +1657,7 @@ static void TownActionBuyRights(Town *t, int action) static void TownActionBribe(Town *t, int action) { if (!RandomRange(15)) { - GoodsEntry *ge; Station *st; - int i, rating; // set as unwanted for 6 months t->unwanted[_current_player] = 6; @@ -1667,8 +1665,9 @@ static void TownActionBribe(Town *t, int action) // set all close by station ratings to 0 FOR_ALL_STATIONS(st) { if (st->town == t && st->owner == _current_player) { - for (i=0, ge = st->goods; i != NUM_CARGO; i++, ge++) - ge->rating = 0; + uint i; + + for (i = 0; i != NUM_CARGO; i++) st->goods[i].rating = 0; } } @@ -1680,9 +1679,9 @@ static void TownActionBribe(Town *t, int action) * ChangeTownRating is only for stuff in demolishing. Bribe failure should * be independent of any cheat settings */ - rating = t->ratings[_current_player]; - if (rating > -50) + if (t->ratings[_current_player] > RATING_BRIBE_DOWN_TO) { t->ratings[_current_player] = RATING_BRIBE_DOWN_TO; + } } else { ChangeTownRating(t, RATING_BRIBE_UP_STEP, RATING_BRIBE_MAXIMUM); } |