swe-teamteam / OpenRCT2

An open source re-implementation of RollerCoaster Tycoon 2 🎢
http://openrct2.website
GNU General Public License v3.0
0 stars 0 forks source link

Deleting sign after copy/paste will cause game to crash #4

Open J-Pinelli opened 7 years ago

J-Pinelli commented 7 years ago

OS: Windows 10 Version: ? Commit/Build: ?

Deleting a sign with the bulldozer after copying it with tile inspector turned on will crash the game

Steps to reproduce:

  1. Enable debug mode in main menu options tab, upper right hand corner
  2. Open any park, dosent matter which
  3. On a any path, construct a sign
  4. Open the tile inspector menu (gear icon in top left of screen ingame)
  5. inspect the tile with the sign on it.
  6. copy it from the menu
  7. click on any other path tile
  8. paste the sign
  9. delete sign using the bulldozer tool.
  10. Game will crash

Screenshots / Video:

signbug

J-Pinelli commented 7 years ago

Pretty sure the issue is at around in src/world/tile_inspector.c Line 252 (Found by ahudson2014)

tile_inspector_paste_element_at() function

The game is creating a new element with a pointer to the original, so when you delete the clone, it also deletes the original and its ID, somehow crashing the game. I think the fix would be creating an entirely new element(i.e. sign) instead of having the pointer. Probably more inefficient, but easier.

crorabaugh2015 commented 7 years ago

This does not cause the game to crash in Ubuntu 16.04 for some reason

crorabaugh2015 commented 7 years ago

I stand corrected, when I use the bulldoze tool to delete the underlying path the game does crash