Skip to content

Commit

Permalink
[18SJ] Add check to Step::AssignGotaKanalbolaget
Browse files Browse the repository at this point in the history
When selling shares in emergency money raising,
Step::AssignGotaKanalbolaget.actions was being called with a player
entity, causing an error when `@game.abilities` was called. This adds a
check to make sure the entity is a corporation.

Fixes #9759.
  • Loading branch information
ollybh committed Dec 26, 2023
1 parent 45a1e5b commit 35f366c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/engine/game/g_18_sj/step/assign_gotakanalbolaget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def description
end

def ability(entity)
return if !entity || !@game.gkb || @game.gkb.owner != entity
return if !entity || !entity.corporation? || !@game.gkb || @game.gkb.owner != entity

ability = @game.abilities(entity, :assign_hexes)
return if !ability || ability.count.zero?
Expand Down

0 comments on commit 35f366c

Please sign in to comment.