Merge lp:~widelands-dev/widelands/bug-impregnable-castles into lp:widelands
Status: | Merged |
---|---|
Merged at revision: | 8706 |
Proposed branch: | lp:~widelands-dev/widelands/bug-impregnable-castles |
Merge into: | lp:widelands |
Diff against target: |
20 lines (+9/-1) 1 file modified
src/wui/attack_box.cc (+9/-1) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug-impregnable-castles |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
GunChleoc | Approve | ||
Review via email: mp+345468@code.launchpad.net |
Commit message
Checking for visibility of military building before permitting attack.
Description of the change
With big military buildings, i.e., castles, it can happen that only the left side of the building is in the visibility range of another player.
If an own military building is near, that player can open the attack window and select and order some soldiers to attack the castle. Only after ordering the attack the game checks whether the door of the building is visible. Since it isn't, no attack happens.
For the player this has the effect that an attack is ordered but is never executed. This branch does an additional visibility check when calculating the number of available soldiers for displaying the UI, returning 0 when the door is invisible and the attack command would fail later on.
Good catch!
Code LGTM, not tested