Skip to content

Commit

Permalink
[1894] Use array.intersect?
Browse files Browse the repository at this point in the history
  • Loading branch information
Galatolol committed Dec 20, 2024
1 parent 5a8da10 commit 664914b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/engine/game/g_1894/step/track.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ def actions(entity)
end

def legal_tile_rotation?(entity, hex, tile)
if @game.class::GREEN_CITY_TILES.include?(hex.tile.name)
entity_reaches_a_new_exit = !(tile.exits & hex_neighbors(entity, hex)).empty?
return false unless entity_reaches_a_new_exit
end
return false if @game.class::GREEN_CITY_TILES.include?(hex.tile.name) &&
!tile.exits.intersect?(hex_neighbors(entity, hex))

return super if hex.id != @game.class::PARIS_HEX || hex.tile.color != :green

Expand Down

0 comments on commit 664914b

Please sign in to comment.