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

Diagonal demolish / level land patch #730

Closed
DorpsGek opened this issue Apr 12, 2007 · 13 comments
Closed

Diagonal demolish / level land patch #730

DorpsGek opened this issue Apr 12, 2007 · 13 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

l_blue_l opened the ticket and wrote:

What this patch does is it lets you demolish or level land diagonally when you use the control key.

This discussion first start on OpenTTD development forum here http://www.tt-forums.net/viewtopic.php?t=31300&postdays=0&postorder=asc&start=0 but will now be discussed on Flyspray.

I did my best to try and complete all the developers comments.

I have changed the # define DO_LEVEL_AREA to a function "int32 LevelLand(....)" but this has coursed a strange bug that courses the GetAvailableMoneyForCommand(); function as this continually returns the original value without updating itself. This means you can spend more money then you have available going into the red. If you could help explain whats happening, a way to fix or different (acceptable) approach that i could take it would really help. Once this bug is resolved i will also change DO_CLEAR_AREA.

Attachments

Reported version: 0.5.0
Operating system: All


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

l_blue_l wrote:

For some reason i forgot to update the coding style for the viewport.h file but this will be included when i upload the next version

Also there is a typo in the first section it is meant to read "courses the GetAvailableMoneyForCommand(); function to* continually returns the original value"


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment1136

@DorpsGek
Copy link
Member Author

DorpsGek commented Jul 5, 2007

NukeBuster wrote:

The bug mentioned in the details part of this task, is fixed. I would like to know, what changes are needed for this patch to be included into the trunk.

The updated patch is attached to this comment.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment1531

@DorpsGek
Copy link
Member Author

NukeBuster wrote:

Updated.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment1646

@DorpsGek
Copy link
Member Author

bove027 wrote:

Is this patch already included in the nightlies? If not, will it be added? This is an option I'm missing very much


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment2706

@DorpsGek
Copy link
Member Author

SmatZ wrote:

#2320 is another patch doing the same (in a bit different way)


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment4793

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

The patches in #2320 are up to date, don't change unrelated files and propose an elegant way to iterate over tiles in rectangular areas. There is a different thread in tt-forums for these, as the original thread has been locked: http://www.tt-forums.net/viewtopic.php?f=33&t=38148

To reiterate it: I will happily change whatever is needed to get the functionality into trunk. Please comment.


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment4794

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

So these are the updated versions of the patches linked to in the last comment.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment5777

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

Another update for the java style patch. I had accidentally removed a range check there which made the game freeze when trying to lower below sea level.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment5855

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

Another update to current trunk. As in the forum thread only the C++ style is maintained and the patch has been split in two for easier review. tileiter provides the general tile iteration functionality which should be reusable in many places. diaglvl is to be applied on top of tileiter.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment6224

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

You can pull these patches from my git repository at http://fickzoo.com/fonsinchen/openttd.git. The branches are named "tileiter" and "diaglvl".
You can also always download up-to-date versions of these patches from http://fickzoo.com/fonsinchen/patches/current/tileiter.diff and http://fickzoo.com/fonsinchen/patches/current/diaglvl.diff The latter is to be applied on top of tileiter. They apply to the version of trunk recorded in http://fickzoo.com/fonsinchen/patches/current/TRUNK_VERSION.txt.


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment6818

@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 6, 2009

fonsinchen wrote:

I have changed the patch to not use the invalid iterator. The syntax was very verbose and you couldn't use diagonal and orthogonal iterators polymorphically. Now there is a method "IsValid" which can be called to see if an iterator is still valid. This is basically the same as checking for inequality with the invalid iterator, but greatly reduces the code size and allows polymorphic usage (as can be seen in CmdClearArea in the diaglvl patch).


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment7025

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

The repository has moved to git://github.com/fonsinchen/openttd-cargodist.git
An up-to-date patch can now be found at http://github.com/fonsinchen/openttd-cargodist/raw/patches/current/diaglvl.diff
The tileiter patch can be found at http://github.com/fonsinchen/openttd-cargodist/raw/patches/current/tileiter.diff
The trunk version they to can be found at http://github.com/fonsinchen/openttd-cargodist/raw/patches/current/TRUNK_VERSION.txt

Unfortunately trunk development has taken a different direction (TileArea) which is incompatible with my approach. I'm still keeping this open as it's a very popular feature and I might reimplement it based on TileArea some time.


This comment was imported from FlySpray: https://bugs.openttd.org/task/730#comment8135

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Implemented

In r21500


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

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay 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/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant