Newly added stations do not generate gold for trains already on their segment when placing them

Open Beginner friendly
#5,538 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
game-dev

Research direction

No file or specific test is named. Start by locating the train gold-generation and station-placement logic, then add a regression test for a train already on a segment when a city is placed. Done means that train generates gold when it reaches the new station, while existing behavior for other trains remains intact.

Written by the indexing model from the issue text.

Description

not-approved

Description

When a station is added on a segment, the trains already on that segment will not generate gold.

The trains not on that segment when the city is placed will still generate gold when passing through this station. This is limited to trains already present on the segment when placing the city

To reproduce

  1. Place one city and one factory with enough place between both for a new city
  2. Wait for a train to spawn
  3. Add a city in front of the train - it will not generate gold when the train goes through it

Expected behavior

The new station should generate gold.

Desktop

  • OS: MacOS
  • Browser: Chrome
  • Version: 34

Additional information

Not a huge deal, but this creates some confusion.

Especially visible in early game, when gold matters most.

Change should be relatively straight-forward and touch only 1 file (+tests).

Assignment

  • I'd like to be assigned to this issue and work on it myself
Dominant language
TypeScript
Stars
2.7k
Forks
1.4k
Avg merge
16h 28m
Merged PRs (30d)
332

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openfrontio/OpenFrontIO

All issues in openfrontio/OpenFrontIO

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.