Bug #694
open
Unsentrying transported unit loses its focus
Added by Marko Lindqvist 6 months ago.
Updated 11 days ago.
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 (1 open — 0 closed)
- Subject changed from Unsetrying transported unit loses its focus to Unsentrying transported unit loses its focus
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.
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.
- Related to Bug #1104: unit_server_side_agent_set(): Send unit info only if ssa_agent really changed added
Also available in: Atom
PDF