Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Bug]: GSTile.DemolishTile() doesn't demolish some entities #10383

Closed
andythenorth opened this issue Jan 21, 2023 · 5 comments
Closed

[Bug]: GSTile.DemolishTile() doesn't demolish some entities #10383

andythenorth opened this issue Jan 21, 2023 · 5 comments
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) enhancement Issue would be a good enhancement; we accept Pull Requests!

Comments

@andythenorth
Copy link
Contributor

Version of OpenTTD

~13 approx

Expected result

The comment for GSTile.DemolishTile() is Destroy everything on the given tile.

Per https://docs.openttd.org/gs-api/classGSTile.html#a5eb630e5a2cc7bcb352c76c4d819cb40

Expected result is that everything on the tile is cleared.

Actual result

Tested in both deity mode and company mode, at least the following are not demolished:

  • all industries
  • houses which appear to have a protected building flag set (needs confirmed)
  • at least some objects, including default transmitters (needs confirmed if these have a protected flag set)
  • there may be others, the ones above are what I found

Either:

  • the comment is wrong and needs updated
  • or the method should demolish the items above (preferred). Possibly an extra optional parameter might be required, to allow GS to respect items intended to be unremovable, or demolish the entire tile.

I can provide a test GS to repro if needed.

Steps to reproduce

Write a GS that tries to clear tiles containing the entities listed above.
Observe that those entities are not cleared.

@James103
Copy link
Contributor

Does the function work as intended if the magic bulldozer cheat is enabled?

@andythenorth
Copy link
Contributor Author

andythenorth commented Jan 21, 2023

Does the function work as intended if the magic bulldozer cheat is enabled?

Yes, at least for company. Haven't got a test immediately to hand with deity.

@2TallTyler 2TallTyler added component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) enhancement Issue would be a good enhancement; we accept Pull Requests! labels Jan 22, 2023
@mrmbernardi
Copy link
Contributor

Can you provide a test GS?

@mrmbernardi
Copy link
Contributor

I'd like to work on this. What's the best way to handle it? One possibility would be allowing destruction of industries/objects via the deity owner (like the water owner) but this could be a big change. I'm not sure how to add flags to the command from the script, and even if I were, it seems there's only one bit left for flags.

@PeterN
Copy link
Member

PeterN commented May 15, 2023

Comment is correct but lacking context.
Basically the context is demolish a tile vs remove bits from a tile.
i.e. you can remove individual road pieces, or demolish the whole tile.
It should definitely not be expected that it will remove otherwise unremovable things.

@OpenTTD OpenTTD locked and limited conversation to collaborators Jan 7, 2024
@TrueBrain TrueBrain converted this issue into discussion #11707 Jan 7, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) enhancement Issue would be a good enhancement; we accept Pull Requests!
Projects
None yet
Development

No branches or pull requests

5 participants