Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#3776) Goto sees ZOC but ignores it
Home

[Freeciv-Dev] Re: (PR#3776) Goto sees ZOC but ignores it

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3776) Goto sees ZOC but ignores it
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Jul 2003 10:40:20 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Gregory Berkolaiko wrote:
> On Tue, 15 Jul 2003, Jason Short wrote:
> 
> 
>>Gregory Berkolaiko wrote:
>>
>>>Please try the attached patch.  Well, actually I have tried it already 
>>>and it works.  But maybe you can find other cases where a fix is needed.
>>>
>>>Note: fogged cities are considered occupied for the purposes of ZoC.  
>>>Hopefully this resolves 3387 as well.
>>
>>>+    pcity = is_non_allied_city_tile(ptile, pplayer);
>>>+    if (pcity && (pcity->occupied || tile_get_known(x1, y1) != TILE_KNOWN)) 
>>>{
>>>+      /* If the city is fogged, we assume it's occupied */
>>>+      return FALSE;
>>>+    }
>>
>>I think you mean "seen" here, not "known".  Perhaps tile_is_known_and_seen?
> 
> 
> No, the code is correct.  Remember, we are in the client here.  By
> tile_is_known_and_seen you probably mean map_get_known_and_seen (strangely
> returning bool), but it is in the server.
> 
> In the client we have tile_get_known which returns
> enum known_type {
>   TILE_UNKNOWN, TILE_KNOWN_FOGGED, TILE_KNOWN
> };
> 
> So everything is ship shape and Bristol fashion.

OK, I see.  Now I understand what the problem was originally...

However, this solution is incomplete.  Now for the client goto map we 
check ZOC.  But any other PF in the client (that uses 
simple_path_unit_iterator) will still use the server's version by default.

In other words, the server implementation should be in the server not in 
the common code.  One alternative might be to have the common-code 
implementation work for both server and client.  This would be ugly 
(checking is_server) but at least it would be localized.

jason




[Prev in Thread] Current Thread [Next in Thread]