Project

General

Profile

Actions

Bug #694

open

Unsentrying transported unit loses its focus

Added by Marko Lindqvist 7 months ago. Updated 27 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
client-common
Target version:
-
Start date:
06/02/2024
Due date:
% Done:

0%

Estimated time:

Description

Split from https://osdn.net/projects/freeciv/ticket/78170 reported by bard. That ticket also has a savegame attached, that can be used to reproduce the issue.

When Unit sentried to a transport is activated (unsentried) by an attempt to move it, it loses focus without doing the actual action. You need to reactivate it (now already unsentried) to do the action.


Related issues 1 (0 open1 closed)

Related to Bug #1104: unit_server_side_agent_set(): Send unit info only if ssa_agent really changedClosedMarko Lindqvist11/11/2024

Actions
Actions #1

Updated by Marko Lindqvist 6 months ago

  • Subject changed from Unsetrying transported unit loses its focus to Unsentrying transported unit loses its focus
Actions #2

Updated by Marko Lindqvist about 1 month ago

There's also a savegame in https://forum.freeciv.org/f/viewtopic.php?t=95076 submitted by Helge where it's the transport (empty one) that is Sentried. Unsentrying that transport moves focus to another unit, in another tile. Seen on S3_1, but not in main branch.

Actions #3

Updated by Marko Lindqvist about 1 month ago

The problem seems to be that the client gets another unit packet before the one setting it to idle, and handle_unit_packet_common() decides to advance focus since the unit has non-idle activity (it still has Sentry activity). This earlier packet comes from clearing the ssa_agent. unit_server_side_agent_set() does the send_unit_info().

Not yet sure what the proper fix would be, but the issue can be greatly mitigated by checking if the ssa_agent actually changes before doing that send_unit_info(). That would fix all the cases where the unit does not have ssa_agent set beforehand either.

Actions #4

Updated by Marko Lindqvist about 1 month ago

  • Related to Bug #1104: unit_server_side_agent_set(): Send unit info only if ssa_agent really changed added
Actions #5

Updated by Marko Lindqvist 27 days ago

Marko Lindqvist wrote in #note-3:

the issue can be greatly mitigated by checking if the ssa_agent actually changes before doing that send_unit_info(). That would fix all the cases where the unit does not have ssa_agent set beforehand either.

Done in #1104

Actions

Also available in: Atom PDF