[Freeciv-Dev] (PR#4781) phantom units showing up on client
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
[glip - Sat Aug 9 19:45:37 2003]:
> On Thu, 7 Aug 2003, Guest wrote:
>
> >
> > Sometimes enemy units are visible, but aren't really there. That is, my
> >
>
> Ha, I got it (well, at least one instance):
>
> handle_unit_attack_request sends combatants' info to many connections,
> which isn't a mistake.
>
> What is a mistake is that the client doesn't remove this information
> properly: in client/packhand.c handle_unit_info, if unit is not new
> something like
>
> if (!(tile_get_known(punit->x,punit->y) == TILE_KNOWN)) {
> cient_remove_unit(punit);
> refresh_tile_mapcanvas(dest_x, dest_y, FALSE);
> }
>
> should be added.
>
> This should be done by somebody who knows what is happening in this
> function, and tested too. The current behaviour when both combatants are
> displayed for a brief moment even though one of them might be under cover
> of fog should stay imo.
>
> I attach a savegame whcih should be helpful. Connect to Israelis
> and Carthagians. Attack French explorer with Carthagian warrior. The
> warrior will be briefly displayed on Israelis' client (center on Israeli
> explorer). When you move Israeli explorer, you can see the phantom
> Carthagian warrior which is no longer.
Unfortunately it's not quite that simple.
I suppose the server must send a unit_info packet to the client to tell
them the unit exists, even though the client can't see it. Then a
unit_combat packet is sent that tells of the combat itself. So if the
_client_ is to remove the unit, it should be done at the end of the
unit_combat packet. The attached patch does this, and fixes the problem
for your savegame.
But, I think the server should send the unit disband packet (or does
this happen as a result of the unit_combat packet?). Or maybe it
already does, and the client ignore it because the unit is not visible?
jason
phantom_unit.diff
Description: phantom_unit.diff
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#4781) phantom units showing up on client,
Jason Short <=
|
|