Workers returning to a building being dismantled will attempt to enter it

Bug #902558 reported by Hans Joachim Desserud on 2011-12-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Low
Unassigned

Bug Description

It recently became possible to dismantle buildings (bug 587251). I noticed soldiers are not always aware that a building is being dismantled. How to reproduce:

1. Have several buildings like barriers close to the border.
2. Attack an enemy building on the other side of the border with all your soldiers.
3. When your soldiers win the fight, they will enter the recently conquered building until it is full. The remaining soldiers will return.
4. In the meantime while the attack was ongoing, decide to dismantle one of the buildings where the attacking soldiers came from.

Expected result:
The soldiers realize they will not be able to go back. When they get back to my territory, they find a road and head to HQ/a warehouse.

Actual result:
A soldier from a building being dismantled will head towards the building he came from. When he arrives he will enter the short road up to the building walk it half the way, then turn around when he realize it is impossible to enter the building. Then he heads toward the HQ/warehouse.

It seems like the soldiers are completely unaware that their building is being dismantled, and need to be informed when they reach the door. (Surprisingly, they don't have any problems accepting this). In effect they spend additional time stopping by their old building rather than doing something more useful. I am not sure whether the same happens if you burn down the building.

Related branches

SirVer (sirver) wrote :

This bug is in the soldier code: they should periodically check if their goal is still available and of the correct type and building type. It will likely not occure when you burn down the building as the code will then realize that there is no "building" there any more but another type of immovabe.

Note that this will likely also happen if the enemy decides to dismantle the building being attacked.

Changed in widelands:
status: New → Confirmed
tags: added: military
cghislai (charlyghislain) wrote :

Also see 1098550

cghislai (charlyghislain) wrote :

Actually this behaviour is observable for all workers. If you dismantle their building while they are outside, they correctly interrupt the task but attempt to enter the building.

tags: added: worker
removed: military
summary: - Soldiers returning to a building being dismantled will attempt to enter
+ Workers returning to a building being dismantled will attempt to enter
it
Changed in widelands:
status: Confirmed → In Progress
milestone: none → build18-rc1
Changed in widelands:
status: In Progress → Fix Committed
SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers