Skip to content

Commit

Permalink
fix: crash when removing guerrilla for Claymores
Browse files Browse the repository at this point in the history
When the unshaded Claymores Momentum event
is in play:
When a moving group of marching guerrillas activates,
one of the activated guerrillas must be removed.
The code was trying to remove an underground guerrilla
and when that did not exist the program crashed.
  • Loading branch information
sellmerfud committed Mar 5, 2024
1 parent f256b30 commit b2dd0a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/scala/fitl/Bot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2684,9 +2684,13 @@ object Bot {
revealPieces(destName, underground)

if (momentumInPlay(Mo_Claymores)) {
log(s"\nMust remove Guerrilla that activated [Momentum: $Mo_Claymores")
log(s"\nMust remove 1 Guerrilla that activated [Momentum: $Mo_Claymores]")
log(separator())
removeToAvailable(destName, Pieces().set(1, underground.getTypes.head))
val activeGuerrilla = if (faction == VC)
Pieces(vcGuerrillas_A = 1)
else
Pieces(nvaGuerrillas_A = 1)
removeToAvailable(destName, activeGuerrilla)
}
log() // Add blank line separator
}
Expand Down

0 comments on commit b2dd0a2

Please sign in to comment.