Prevent senseless BattleTable display and fix right-click issues #7003
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Select a city, then select a city from another nation. You get the BattleTable "what-if I could bombard that city". Even if half the world away. Pretty senseless. I thought - OK, try to limit, but don't just prevent display if no attack possible. Maybe display if the battle could conceivably happen next turn. This is only on approximation so far, but it already feels better.
Thing is, getMaxMovement returns 1 for air units. No relation to reality. But, with this code, I could "compare strengths" with a Bomber and a City one tile outside its range, but not one two tiles too far. Should I fix this in the original Unit getMaxMovement code, or in the ICombatant proxy I added because it makes sense and things easier, or correct in the threatRange calculation? Once that is done, should I "predict" increased range ("could happen next turn") for: -Operational Range promotion? -Relocation to another City? Simplify potential relocation as a guesstimate by not checking cities one could relocate to but simply doubling range?
The right-click issues part - after a RC move currently TileInfoTable is wrong, and after a RC attack the unit info too. Or - select an Artillery, then a city on another continent 30 tiles away. You get the BattleTable. Now RC-move it one tile - the BattleTable is still there. With the above fix this could look even more ridiculous, with the BT appearing after a RC move because the selectedTile still remembered an ages old selection... I think these lines a left click would do but were missing in RC should do it. Please comment if anybody knows counter arguments.