| [Freeciv-Dev] (PR#10346) [Bugfix] Correct add_to_size_limit check in cit[Top] [All Lists][Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
| To: | undisclosed-recipients: ; |  
| Subject: | [Freeciv-Dev] (PR#10346) [Bugfix] Correct add_to_size_limit check in city_desirability() |  
| From: | "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx> |  
| Date: | Sun, 26 Sep 2004 08:16:18 -0700 |  
| Reply-to: | rt@xxxxxxxxxxx |  
 
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10346 >
  city_desirability() and test_unit_add_or_build_city() check 
add_to_size_limit differently. city_desirability() checks if we have 
already reached that limit and test_unit_add_or_build_city() checks if 
we are going to get over limit. This makes a difference when 
unit_pop_value > 1.
  Attached patch makes check in city_desirability() similar to one in 
test_unit_add_or_build_city().
  - Caz
 diff -Nurd -X.diff_ignore freeciv/ai/aisettler.c freeciv/ai/aisettler.c
--- freeciv/ai/aisettler.c      2004-09-26 11:50:52.031250000 +0300
+++ freeciv/ai/aisettler.c      2004-09-26 18:05:17.406250000 +0300
@@ -406,7 +406,7 @@
     return;
   }
 
-  if (pcity && pcity->size >= game.add_to_size_limit) {
+  if (pcity && pcity->size + unit_pop_value(punit->type) > 
game.add_to_size_limit) {
     return;
   }
 
 
| [Prev in Thread] | Current Thread | [Next in Thread] |  
[Freeciv-Dev] (PR#10346) [Bugfix] Correct add_to_size_limit check in city_desirability(),
Marko Lindqvist <=
 
 |  |