Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when trying to delete town in scenario editor #7440

Closed
buttercup5 opened this issue Mar 29, 2019 · 2 comments
Closed

Crash when trying to delete town in scenario editor #7440

buttercup5 opened this issue Mar 29, 2019 · 2 comments
Assignees
Labels
regression It used to work, and now it's broken.

Comments

@buttercup5
Copy link

Version of OpenTTD

20190329-master-g1d14e31be3-windows-win64

Expected result

Clicking on Delete in the town window when in the Scenario Editor should delete the town.

Actual result

Clicking on Delete in the town window when in the Scenario Editor crashes the game.

Steps to reproduce

  1. Go into the scenario editor
  2. Create a town
  3. Try to delete the town
  4. Crash game
@nielsmh nielsmh added the regression It used to work, and now it's broken. label Mar 29, 2019
@nielsmh
Copy link
Contributor

nielsmh commented Mar 29, 2019

Yep I can reproduce this. Seems to be an issue with viewport signs not being updated correctly in the k-d tree.

@nielsmh nielsmh self-assigned this Mar 29, 2019
@JGRennison
Copy link
Contributor

See: https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp#L2874

_viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeTown(t->index)); is called from within CmdDeleteTown, which looks wrong.

Changing Insert to Remove is sufficient to make the problem go away.

nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 1, 2019
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 1, 2019
@nielsmh nielsmh closed this as completed in cebdd72 Apr 2, 2019
douiwby pushed a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression It used to work, and now it's broken.
Projects
None yet
Development

No branches or pull requests

3 participants