Skip to content

Commit

Permalink
Revert "Merge pull request #9029 from michaeljb/fix-9026"
Browse files Browse the repository at this point in the history
This reverts commit f7802e2, reversing
changes made to 401c561.
  • Loading branch information
michaeljb committed Mar 27, 2023
1 parent 0bf2ed4 commit 33c032b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
3 changes: 0 additions & 3 deletions lib/engine/game/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2083,9 +2083,6 @@ def bankruptcy_limit_reached?

def update_tile_lists(tile, old_tile)
add_extra_tile(tile) if tile.unlimited

raise GameError, "Cannot lay tile #{tile.id}; it is already on hex #{tile.hex.id}" if tile.hex

@tiles.delete(tile)
@tiles << old_tile unless old_tile.preprinted
end
Expand Down
9 changes: 1 addition & 8 deletions lib/engine/game/double_sided_tiles.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require_relative '../game_error'

# This module is used by games which double sided tiles, providing methods for
# initializing double-sided tiles and keeping tile lists updated appropriately.
module DoubleSidedTiles
Expand All @@ -16,7 +14,7 @@ def initialize_tile_opposites!
num = by_name[name_a].size

if num != by_name[name_b].size
raise Engine::GameError, "Sides of double-sided tiles need to have same number (#{name_a}, #{name_b})"
raise GameError, "Sides of double-sided tiles need to have same number (#{name_a}, #{name_b})"
end

num.times.each do |index|
Expand Down Expand Up @@ -44,11 +42,6 @@ def update_tile_lists(tile, old_tile)
end
end

raise Engine::GameError, "Cannot lay tile #{tile.id}; it is already on hex #{tile.hex.id}" if tile.hex
if tile.opposite&.hex
raise Engine::GameError, "Cannot lay tile #{tile.id}; #{tile.opposite.id} is already on hex #{tile.opposite.hex.id}"
end

@tiles.delete(tile)
if tile.opposite
@tiles.delete(tile.opposite)
Expand Down

0 comments on commit 33c032b

Please sign in to comment.