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

Implement removeAirport game command #2454

Merged
merged 21 commits into from
May 13, 2024

Conversation

AaronVanGeffen
Copy link
Member

@AaronVanGeffen AaronVanGeffen commented Apr 19, 2024

Has a few issues to be worked out still

@AaronVanGeffen AaronVanGeffen marked this pull request as ready for review May 7, 2024 14:30
@AaronVanGeffen
Copy link
Member Author

@duncanspumpkin I think that's the remaining bugs in the implementation worked out. Airports can be removed and created without issue now.

StationId stationId = StationId::null;
if ((flags & Flags::ghost) != 0)
{
return loc_49372F(stationId, *stationEl, args.pos, flags);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't how we have generally written these functions normally we just do

if (!isGhost){
   ... // non ghost code
}
... // everyone code

i mean its fine to do its just a bit odd.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I needed it to understand the jumping that was going on. To be honest, I prefer having two functions of this length over one big function. Question is what to name it, though.

Copy link
Contributor

@duncanspumpkin duncanspumpkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

src/OpenLoco/src/GameCommands/Airports/RemoveAirport.cpp Outdated Show resolved Hide resolved
src/OpenLoco/src/GameCommands/Airports/RemoveAirport.cpp Outdated Show resolved Hide resolved
src/OpenLoco/src/GameCommands/Airports/RemoveAirport.cpp Outdated Show resolved Hide resolved
src/OpenLoco/src/GameCommands/Airports/RemoveAirport.cpp Outdated Show resolved Hide resolved
@AaronVanGeffen
Copy link
Member Author

I've added the helper as requested in the latest commit. However, there must be a mistake, as it no longer completely removes the airport. Debugging suggests all parts are accounted for, however.

Things appear to be working fine on the previous commit, so it must be due to these latest changes. I could do with a second pair of eyes on this.

Copy link
Contributor

@duncanspumpkin duncanspumpkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No divergences

@AaronVanGeffen AaronVanGeffen merged commit 9f6c616 into OpenLoco:master May 13, 2024
9 checks passed
@AaronVanGeffen AaronVanGeffen deleted the gc/remove-airport branch May 13, 2024 21:07
@duncanspumpkin duncanspumpkin added this to the v24.05.1+ milestone May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (PRs)
Development

Successfully merging this pull request may close these issues.

None yet

2 participants