-
Notifications
You must be signed in to change notification settings - Fork 92
change planer algorithms to match the original #1908
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -29,7 +29,10 @@ noBuildingSite::noBuildingSite(const BuildingType type, const MapPoint pos, cons | |||||||||
| || GetSize() == BuildingQuality::Harbor) | ||||||||||
| { | ||||||||||
| // Höhe auf dem Punkt, wo die Baustelle steht | ||||||||||
| int altitude = world->GetNode(pos).altitude; | ||||||||||
| int altitude = world->GetNode(this->GetFlagPos()).altitude; | ||||||||||
|
|
||||||||||
| if(altitude - world->GetNode(pos).altitude != 0) | ||||||||||
| state = BuildingSiteState::Planing; | ||||||||||
|
Comment on lines
+34
to
+35
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enhance check (same below) and indent
Suggested change
And put the loop into an
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually removed the tabbed indents by hand, as my editor is set to kernel style. And the very awkward calculation matches the rest of the code. So when reviewing this patch, please see the context, i have done extra work to match the rest of the codebase.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I now see there is a tab left, yes. You can use clang-format to auto-format. If it is found by configure there is even a build target for that. CI will tell you too once run This wasn't criticism of your work and matching this (strange) style is certainly right in general. My suggestion here is to fix/use the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, from where I sit, once you start refactoring code, you never stop :) I would just use the old style here and let it be until someone uses lindent on whole files. |
||||||||||
|
|
||||||||||
| for(const auto dir : helpers::EnumRange<Direction>{}) | ||||||||||
| { | ||||||||||
|
|
@@ -377,6 +380,8 @@ void noBuildingSite::PlaningFinished() | |||||||||
| state = BuildingSiteState::Building; | ||||||||||
| planer = nullptr; | ||||||||||
|
|
||||||||||
| world->ChangeAltitude(pos, world->GetNode(this->GetFlagPos()).altitude); | ||||||||||
|
|
||||||||||
| // Wir hätten gerne einen Bauarbeiter... | ||||||||||
| world->GetPlayer(player).AddJobWanted(Job::Builder, this); | ||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this easier to understand: