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

 Since previous vision site cleanup removed vision site references
from tiles where city is not, checks in map_get_player_city() are
unnecessary. Attached patch removes some of them, and changes some of
them into asserts.
 Now only difference between map_get_player_site() and
map_get_player_city() are these asserts in map_get_player_city(). I
decided not to completely remove map_get_player_site() until I'm sure
we are not going to need it in the future.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/maphand.c freeciv/server/maphand.c
--- freeciv/server/maphand.c	2009-02-20 16:39:23.000000000 +0200
+++ freeciv/server/maphand.c	2009-02-23 14:27:18.000000000 +0200
@@ -936,15 +936,13 @@
 {
   struct vision_site *psite = map_get_player_site(ptile, pplayer);
 
-  if (NULL != psite && ptile == psite->location
-   && IDENTITY_NUMBER_ZERO < psite->identity) {
-    return psite;
-  }
-  return NULL;
+  assert(psite == NULL || psite->location == ptile);
+ 
+  return psite;
 }
 
 /****************************************************************************
-  ...
+  Returns site located at given tile from player map.
 ****************************************************************************/
 struct vision_site *map_get_player_site(const struct tile *ptile,
 					const struct player *pplayer)
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to