src/town_cmd.cpp
changeset 8683 1f3141299c8e
parent 8682 c41d89c0ca8f
child 8693 3d721429cc4f
--- a/src/town_cmd.cpp	Thu Jan 03 23:50:58 2008 +0000
+++ b/src/town_cmd.cpp	Thu Jan 03 23:54:23 2008 +0000
@@ -522,8 +522,8 @@
 		}
 	}
 
-	ChangeTownRating(t, -rating, RATING_HOUSE_MINIMUM);
 	if (flags & DC_EXEC) {
+		ChangeTownRating(t, -rating, RATING_HOUSE_MINIMUM);
 		ClearTownHouse(t, tile);
 	}
 
@@ -2261,23 +2261,6 @@
 	}
 }
 
-static bool _town_rating_test = false;
-
-void SetTownRatingTestMode(bool mode)
-{
-	static int ref_count = 0;
-	if (mode) {
-		if (ref_count == 0) {
-			Town *t;
-			FOR_ALL_TOWNS(t) t->test_rating = t->ratings[_current_player];
-		}
-		ref_count++;
-	} else {
-		assert(ref_count > 0);
-		ref_count--;
-	}
-	_town_rating_test = !(ref_count == 0);
-}
 
 void ChangeTownRating(Town *t, int add, int max)
 {
@@ -2292,7 +2275,7 @@
 
 	SetBit(t->have_ratings, _current_player);
 
-	rating = _town_rating_test ? t->test_rating : t->ratings[_current_player];
+	rating = t->ratings[_current_player];
 
 	if (add < 0) {
 		if (rating > max) {
@@ -2305,11 +2288,7 @@
 			if (rating > max) rating = max;
 		}
 	}
-	if (_town_rating_test) {
-		t->test_rating = rating;
-	} else {
-		t->ratings[_current_player] = rating;
-	}
+	t->ratings[_current_player] = rating;
 }
 
 /* penalty for removing town-owned stuff */
@@ -2334,7 +2313,7 @@
 	 */
 	modemod = _default_rating_settings[_opt.diff.town_council_tolerance][type];
 
-	if ((_town_rating_test ? t->test_rating : t->ratings[_current_player]) < 16 + modemod && !(flags & DC_NO_TOWN_RATING)) {
+	if (t->ratings[_current_player] < 16 + modemod && !(flags & DC_NO_TOWN_RATING)) {
 		SetDParam(0, t->index);
 		_error_message = STR_2009_LOCAL_AUTHORITY_REFUSES;
 		return false;