<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40377 >

 Functions normal_player_count() and player_count_no_barbarians() do
exactly same thing. Attached patch removes
player_count_no_barbarians()


 - ML

diff -Nurd -X.diff_ignore freeciv/ai/aicity.c freeciv/ai/aicity.c
--- freeciv/ai/aicity.c 2008-06-26 23:22:30.000000000 +0300
+++ freeciv/ai/aicity.c 2008-07-14 23:32:51.000000000 +0300
@@ -795,7 +795,7 @@
 {
   int v = 0;
   int cities[REQ_RANGE_LAST];
-  int nplayers = player_count_no_barbarians();
+  int nplayers = normal_player_count();
   struct ai_data *ai = ai_data_get(pplayer);
   bool capital = is_capital(pcity);
   bool can_build = TRUE;
diff -Nurd -X.diff_ignore freeciv/server/citytools.c freeciv/server/citytools.c
--- freeciv/server/citytools.c  2008-07-03 02:25:58.000000000 +0300
+++ freeciv/server/citytools.c  2008-07-14 23:35:27.000000000 +0300
@@ -1305,7 +1305,7 @@
   if (is_capital(pcity)
       && city_list_size(cplayer->cities) >= game.info.civilwarsize
       && game.info.civilwarsize < GAME_MAX_CIVILWARSIZE
-      && player_count_no_barbarians() < MAX_NUM_PLAYERS
+      && normal_player_count() < MAX_NUM_PLAYERS
       && civil_war_triggered(cplayer)) {
     try_civil_war = TRUE;
   }
diff -Nurd -X.diff_ignore freeciv/server/meta.c freeciv/server/meta.c
--- freeciv/server/meta.c       2008-06-24 22:39:48.000000000 +0300
+++ freeciv/server/meta.c       2008-07-14 23:40:34.000000000 +0300
@@ -52,7 +52,9 @@
 #include "timing.h"
 #include "version.h"
 
+/* server */
 #include "console.h"
+#include "plrhand.h"
 #include "srv_main.h"
 
 #include "meta.h"
@@ -272,7 +274,7 @@
     s = end_of_strn(s, &rest);
 
     /* NOTE: send info for ALL players or none at all. */
-    if (player_count_no_barbarians() == 0) {
+    if (normal_player_count() == 0) {
       mystrlcpy(s, "dropplrs=1&", rest);
       s = end_of_strn(s, &rest);
     } else {
diff -Nurd -X.diff_ignore freeciv/server/sernet.c freeciv/server/sernet.c
--- freeciv/server/sernet.c     2008-06-28 17:49:11.000000000 +0300
+++ freeciv/server/sernet.c     2008-07-14 23:33:11.000000000 +0300
@@ -1209,7 +1209,7 @@
   }
 
    my_snprintf(players, sizeof(players), "%d",
-               player_count_no_barbarians());
+               normal_player_count());
    my_snprintf(port, sizeof(port), "%d",
               srvarg.port );
 
diff -Nurd -X.diff_ignore freeciv/server/srv_main.c freeciv/server/srv_main.c
--- freeciv/server/srv_main.c   2008-07-07 19:04:55.000000000 +0300
+++ freeciv/server/srv_main.c   2008-07-14 23:31:38.000000000 +0300
@@ -1119,14 +1119,6 @@
 }
 
 /**************************************************************************
-...
-**************************************************************************/
-int player_count_no_barbarians(void)
-{
-  return player_count() - server.nbarbarians;
-}
-
-/**************************************************************************
 Returns 0 if connection should be closed (because the clients was
 rejected). Returns 1 else.
 **************************************************************************/
diff -Nurd -X.diff_ignore freeciv/server/srv_main.h freeciv/server/srv_main.h
--- freeciv/server/srv_main.h   2008-05-06 03:59:25.000000000 +0300
+++ freeciv/server/srv_main.h   2008-07-14 23:31:47.000000000 +0300
@@ -96,7 +96,6 @@
 void identity_number_release(int id);
 void identity_number_reserve(int id);
 int identity_number(void);
-int player_count_no_barbarians(void);
 void server_game_init(void);
 void server_game_free(void);
 void aifill(int amount);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to