Closed nibuen closed 2 years ago
Here it is fixed on my repo, note I am probably going to significantly refactor into kotlin after this point so wanted to give you a sane spot to help fix: https://github.com/nibuen/SpaceAlertMissionGenerator/blob/94e5f6efcf3417e152cb8e815db0681f1fe298cc/app/src/main/java/com/boarbeard/generator/beimax/MissionImpl.java#L831
Here is the test that helped catch it: https://github.com/nibuen/SpaceAlertMissionGenerator/blob/94e5f6efcf3417e152cb8e815db0681f1fe298cc/app/src/test/java/com/boarbeard/generator/beimax/TestMissionImplJvm.kt#L112
Arg, thanks for catching this! You are right, this is needed. And the move to Kotlin is definitely a sane one! I have been contemplating about something like this myself, but lack time to do so atm.
In generatePhases() you aren't deep copying the new mutable object threatGroup which causes issues where you can generate missions with no threats as they have been removed in previous fitting patterns. Will link my fix to this in the Android repo.
https://github.com/mkalus/JSpaceAlertMissionGenerator/blob/9a007afc21b7ab63901dc8258fb1fce1b49714ef/src/main/java/de/beimax/spacealert/mission/MissionImpl.java#L744