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

Comments

@buttercup5
Copy link

@buttercup5 buttercup5 commented Mar 29, 2019

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 label Mar 29, 2019
@nielsmh

This comment has been minimized.

Copy link
Contributor

@nielsmh 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

This comment has been minimized.

Copy link
Contributor

@JGRennison JGRennison commented Apr 1, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.