Bug #694
openUnsentrying transported unit loses its focus
0%
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.
Updated by Marko Lindqvist 6 months ago
- Subject changed from Unsetrying transported unit loses its focus to Unsentrying transported unit loses its focus
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.
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.
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