Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2002:
[Freeciv-Dev] Re: [Bug][Patch] Persistent stealth units (PR#2047)
Home

[Freeciv-Dev] Re: [Bug][Patch] Persistent stealth units (PR#2047)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Development List <freeciv-dev@xxxxxxxxxxx>, "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>, Raimar Falke <rf13@xxxxxxxxxxxxxxxxxxxxxx>
Cc: Freeciv Bugs/Patch Tracking <bugs@xxxxxxxxxxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Bug][Patch] Persistent stealth units (PR#2047)
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Thu, 12 Sep 2002 14:15:02 +0100 (BST)

Okay, so the previous patch did not fully fix the problem, as client was 
tending to keep erroneous information and even to show it if really 
asked.

While doing thorough testing I discovered another bug which I am sure 
dates to pre-1.12: if your unit moves up to a previously invisible enemy 
unit, the previously invisible enemy unit stays invisible.  The reason for 
it as follows:

when a unit moves (move_unit) the following happens to the visibility

1. unfog new tiles  (send all unit info form there)
2. transfer the unit
3. fog old tiles

Unfogging here does not always reveal the hidden units, since to reveal 
the hidden units, it needs one of your unit next to it and it hasn't been 
transferred yet!!  

Also, unfogging (really_unfog_area) is performed only in some cases. so
the swapping around 1 and 2 wouldn't always work.  Instead I forcibly make
server reveal hidden units right after the transfer.  This is done in
my patch in reveal_hidden_units function.  It's placement is somewhat 
dubious but I wanted to keep it near fogging stuff.

The patch is attached.

G.

On Wed, 11 Sep 2002, Gregory Berkolaiko wrote:

> Ok, I am tired of this stupid bug, so I made a fix.  It's been reported 
> already but I cannot find the number.
> 
> The bug:
> Stealth units (flying and submarines) appear next to your cities, do the 
> job and _don't_ disappear when they move away
> 
> The cause:
> When a stealth (F_PARTIAL_INVIS) unit moves away the corresponding update 
> is not sent to the client for the fear of client having too much info.
> 
> The cure:
> Send the info to the client if either previous or current location is 
> visible by the client's owner.  This will cause client having slightly 
> more info than displayed but it is a standard practice with FoW and not 
> cheating at all: you can see which direction the unit left so effectively 
> (if you're infinitely vigilant) you know the location of stealth unit even 
> if it's not displayed.
> 
> The patch:
> Compiles and seem to work.
> 
> Complaints:
> If any, should be directed to those who introduced the bug on 01.06.02 ;)
> 
> Best wishes,
> G.
> 

Attachment: stealth2.diff
Description: Text document


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