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

Removing docks converts rivers into canals #1676

Closed
DorpsGek opened this issue Jan 21, 2008 · 6 comments
Closed

Removing docks converts rivers into canals #1676

DorpsGek opened this issue Jan 21, 2008 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

frosch opened the ticket and wrote:

Docks can be built on rivers, but when they get bulldozed they create a canal tile.

Btw. shipdepots and buoys can't be built on rivers at all.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/1676
@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 1, 2008

Belugas wrote:

I may have found a way to fix it.
Two problems:

  1. the assumption that anything above sea level must be a canal
  2. the omission to add river to the has_water condition
    Here is the patch i am proposing

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1676#comment3417

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 1, 2008

Belugas wrote:

yeah... a not related additionnal line feed for code breathing purpose ;)


This comment was imported from FlySpray: https://bugs.openttd.org/task/1676#comment3418

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 1, 2008

frosch wrote:

If I am not mistaken, that does also not result in rivers.

Btw. I would prefer a really clean solution here. Looking into openttd.cpp reveals that this is about the fifth time, that canals/sea get converted in savegames :)

I thought about changing the map array in the following way:
- Remove WATER_TILE_RIVER and store rivers with WATER_TILE_CLEAR (like canals and sea).
- Add a WaterClass type in m3 bits 0 to 1 (this position is used for railway and road types in MP_STATION) to differ between sea, canals, and rivers.
- This WaterClass can be used in all water stuff (clear water, depot, dock, buoy) as these bits are free. I.e. also remove the water_owner from shipdepot.
- Preserve WaterClass when building/removing things on water.

That would also allow to draw matching ground sprites under shipdepots, docks and buoys. (Though that would require to store the random bits of canals and rivers also in MP_STATION. m4 would be free, but perhaps it is not the best choice.)


This comment was imported from FlySpray: https://bugs.openttd.org/task/1676#comment3420

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 1, 2008

peter1138 wrote:

That sounds reasonable to me. Random bits can just return zero for docks, as I doubt it is necessary there.

Any downsides?


This comment was imported from FlySpray: https://bugs.openttd.org/task/1676#comment3421

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 1, 2008

Belugas wrote:

I like the idea too, as it would make the code clearer.
As for downsides, who knows...


This comment was imported from FlySpray: https://bugs.openttd.org/task/1676#comment3422

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 2, 2008

peter1138 closed the ticket.

Reason for closing: Fixed

In r12042


This comment was imported from FlySpray: https://bugs.openttd.org/task/1676

@DorpsGek DorpsGek closed this as completed Feb 2, 2008
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant