Skip to content

Receivership entities appear twice in Entity view #11929

@perwestling

Description

@perwestling

A corporation in receivership appears twice under Bank.

What's your Game ID?

I believe this is a general issue, but I did encounter it during play test of a new title.

How to Reproduce the Bug?

Set a corporation into receivership.
Go to Entity tab.

Which Browser / Platform?

N/A

Likely source of problem

In entity.rb (view) the following code renders the corporations:

extra_bank = []
if @game.respond_to?(:unstarted_corporation_summary)
  others = @game.unstarted_corporation_summary.last
  extra_bank.concat(others.map { |c| h(Corporation, corporation: c) })
else
  extra_bank.concat(bank_owned.map { |c| h(Corporation, corporation: c) })
end
children << h(:div, [
  h(Bank, game: @game),
  h(GameInfo, game: @game, layout: 'upcoming_trains'),
  *@game.unowned_purchasable_companies(@current_entity).map { |company| h(Company, company: company) },
  *@game.receivership_corporations.map { |c| h(Corporation, corporation: c) },
  *extra_bank,
].compact)

The base implementation of receivership_corporations is just to select all corporations that is in receivership.
At the same time all corporations are split into player_owned and bank_owned. Therefor the corporation appear in two places, giving the duplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions