Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stalemate logic to end 0 att plane vs. transport fights. #11736

Merged
merged 4 commits into from
Jul 8, 2023

Conversation

asvitkine
Copy link
Contributor

@asvitkine asvitkine commented Jul 5, 2023

Change Summary & Additional Notes

Without this, we would trigger the 10K rounds limit in AI simulation when the battle ends up with a strat bomber (that has no attack or defense) faced off against a transport and/or subs, and neither would be able to damage the other.

Added a unit test. Also renames a couple of existing tests for clarity.

Fixes: #10936

Note: This problem does not exist in 2.5 (tested).

Release Note

@asvitkine asvitkine marked this pull request as draft July 5, 2023 21:24
@asvitkine asvitkine marked this pull request as ready for review July 6, 2023 01:26
@panther2
Copy link
Contributor

panther2 commented Jul 6, 2023

@asvitkine
Why can't a strat bomber hit a transport? That's quite unusual.
That must be a speciality of the specific map?

@TheDog-GH
Copy link
Contributor

TheDog-GH commented Jul 6, 2023

Its from Global 40 House Rules with Canada

Above is not my map, however I have tried something similar for one of mine.

Here is an xml extract of the bomber

    <!-- BomberA0C5 -->
    <attachment name="unitAttachment" attachTo="bomberA0C5" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="6"/>
      <option name="isAir" value="true"/>
      <option name="attack" value="0"/>
      <option name="defense" value="0"/>
      <option name="isStrategicBomber" value="true"/>
      <option name="isInfrastructure" value="true"/>
      <option name="bombingMaxDieSides" value="6"/>
      <option name="canBeGivenByTerritoryTo" value="British"/>
      <option name="airAttack" value="0"/>
      <option name="canAirBattle" value="true"/>
      <option name="destroyedWhenCapturedBy" value="Germans:Russians:Americans:British:UK_Pacific:French:Italians:Japanese:Chinese:ANZAC:French:Dutch"/>
    </attachment>

@asvitkine
Copy link
Contributor Author

Right, sorry in this case the strat bomber has no att/def, only used to damage factories, etc.

@asvitkine asvitkine changed the title Fix stalemate logic to end stratBomber vs. transport fights. Fix stalemate logic to end 0 att plane vs. transport fights. Jul 8, 2023
@asvitkine asvitkine merged commit 1ce5884 into triplea-game:master Jul 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.6+93c2e16: ConcurrentBattleCalculator#calculate:196 - java.lang.IllegalStateException
3 participants