Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] (PR#7408) Client knows about hidden units
Home

[Freeciv-Dev] (PR#7408) Client knows about hidden units

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: matusik_s@xxxxx
Subject: [Freeciv-Dev] (PR#7408) Client knows about hidden units
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 Feb 2004 23:49:32 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [matusik_s@xxxxx - Mon Feb 16 07:43:52 2004]:

> There's another problem: Suppose that Player B has a loaded transport
> within sight of player A. They have shared vision.
> Then player B removes shared vision and moves his transport. Server
> doesn't remove units inside transport from A's client.

Is this definitely the case?  Can someone provide a savegame to show it?

We're back to the original two solutions for this one.  Either we track
whether the player "knows" about the unit, and send a delete when this
changes, or we introduce a check every time a condition for the
knowledge changes.

The latter would be done like this: when alliance is removed, iterate
over all units on all tiles occupied by the player.  For each unit, if
the other player *could* see the unit before but *can't* now, it goes
out of sight.  This is very ugly!  can_player_see_unit has a lot of
checks but it's very localized.  Duplicating this logic all over the
place is something to be avoided.

jason




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