(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
This commit is contained in:
tron
2005-10-23 13:04:44 +00:00
parent 2cc2154ad2
commit 47137cefb7
38 changed files with 442 additions and 453 deletions

View File

@@ -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);
}