Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#5465) client can see all enemy units in stacks
Home

[Freeciv-Dev] (PR#5465) client can see all enemy units in stacks

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#5465) client can see all enemy units in stacks
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Jan 2004 23:33:49 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=5465 >

> [chrisk - Mon Sep 01 09:48:34 2003]:
> 
> For the design board:
> 
> 
> Unit content of all stacks in vision range can be seen if not in a  
> container. Allied units in a container can be seen by a player if he has  
> at least one unit in the stack. Non allied units in a container can't be  
> seen in all cases.
> 
> (container is city sea/possible-future-air transport)  

Yes...

Currently the client cannot see units in non-allied cities.

Currently the client cannot see units in non-shared-vision transports.

The latter is flawed: it should also be non-allied cities.  This obeys
both the decrees of the design board and also logic.  The player must be
able to see inside his allies' transports since he can move his units there.

The attached patch fixes this.

jason

Index: common/player.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/player.c,v
retrieving revision 1.130
diff -u -r1.130 player.c
--- common/player.c     2003/11/28 17:37:21     1.130
+++ common/player.c     2004/01/31 07:32:07
@@ -287,8 +287,11 @@
 bool can_player_see_unit_at2(struct player *pplayer, struct unit *punit,
                             int x, int y)
 {
+  /* Don't show non-allied units that are in transports.  This is logical
+   * because allied transports can also contain our units.  Shared vision
+   * isn't taken into account. */
   if (punit->transported_by != -1 && unit_owner(punit) != pplayer
-      && !gives_shared_vision(unit_owner(punit), pplayer)) {
+      && !pplayers_allied(pplayer, unit_owner(pplayer))) {
     return FALSE;
   }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#5465) client can see all enemy units in stacks, Jason Short <=