diff src/town_cmd.cpp @ 9652:a05d108fe78f draft

(svn r13719) -Codechange: rename IsValidPlayer to IsValidPlayerID in line with all other structs/classes that are in a pool.
author rubidium <rubidium@openttd.org>
date Thu, 17 Jul 2008 20:13:01 +0000 (2008-07-17)
parents 3686a9dc67d5
children 27697e657d2e
line wrap: on
line diff
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -529,7 +529,7 @@
 	_cleared_town_rating += rating;
 	Town *t = _cleared_town = GetTownByTile(tile);
 
-	if (IsValidPlayer(_current_player)) {
+	if (IsValidPlayerID(_current_player)) {
 		if (rating > t->ratings[_current_player] && !(flags & DC_NO_TOWN_RATING) && !_cheats.magic_bulldozer.value) {
 			SetDParam(0, t->index);
 			return_cmd_error(STR_2009_LOCAL_AUTHORITY_REFUSES);
@@ -2314,12 +2314,12 @@
 		if (DistanceSquare(st->xy, t->xy) <= t->squared_town_zone_radius[0]) {
 			if (st->time_since_load <= 20 || st->time_since_unload <= 20) {
 				n++;
-				if (IsValidPlayer(st->owner)) {
+				if (IsValidPlayerID(st->owner)) {
 					int new_rating = t->ratings[st->owner] + RATING_STATION_UP_STEP;
 					t->ratings[st->owner] = min(new_rating, INT16_MAX); // do not let it overflow
 				}
 			} else {
-				if (IsValidPlayer(st->owner)) {
+				if (IsValidPlayerID(st->owner)) {
 					int new_rating = t->ratings[st->owner] + RATING_STATION_DOWN_STEP;
 					t->ratings[st->owner] = max(new_rating, INT16_MIN);
 				}
@@ -2405,7 +2405,7 @@
 
 bool CheckIfAuthorityAllows(TileIndex tile)
 {
-	if (!IsValidPlayer(_current_player)) return true;
+	if (!IsValidPlayerID(_current_player)) return true;
 
 	Town *t = ClosestTownFromTile(tile, _settings_game.economy.dist_local_authority);
 	if (t == NULL) return true;
@@ -2482,7 +2482,7 @@
 {
 	/* if magic_bulldozer cheat is active, town doesn't penaltize for removing stuff */
 	if (t == NULL ||
-			!IsValidPlayer(_current_player) ||
+			!IsValidPlayerID(_current_player) ||
 			(_cheats.magic_bulldozer.value && add < 0)) {
 		return;
 	}
@@ -2520,7 +2520,7 @@
 bool CheckforTownRating(uint32 flags, Town *t, byte type)
 {
 	/* if magic_bulldozer cheat is active, town doesn't restrict your destructive actions */
-	if (t == NULL || !IsValidPlayer(_current_player) || _cheats.magic_bulldozer.value)
+	if (t == NULL || !IsValidPlayerID(_current_player) || _cheats.magic_bulldozer.value)
 		return true;
 
 	/* check if you're allowed to remove the street/bridge/tunnel/industry