-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Refactor map size to allow for rectangle maps #16259
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
Refactor map size to allow for rectangle maps #16259
Conversation
98e0cf0 to
7a84322
Compare
d8c2abe to
1e266aa
Compare
5325dee to
c93cc78
Compare
| if (customLocation) | ||
| { | ||
| if (centreMapX) | ||
| customX = (mapSize / 2) * 32 + 16; |
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.
customX/customY should be refactored in another PR (making a note so that I don’t forget).
|
|
||
| if (!LocationValid(_location) || _location.x <= 16 || _location.y <= 16 || _location.x >= (GetMapSizeUnits() - 16) | ||
| || _location.y >= (GetMapSizeUnits() - 16)) | ||
| auto mapSizeUnits = GetMapSizeUnits() - CoordsXY{ 16, 16 }; |
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.
We should have a constant for 16 too, I think. Something like HALF_TILE. But this can be done in another PR too.
|
Getting there, found 1 possible mistake and a few code style/quality things. |
48b8ced to
c409faf
Compare
c409faf to
4429411
Compare
The map size game action has changed to allow for both width and height to be specified.
This means, plugin API is increased, and any plugins using the map size change action must be updated.
The network version has changed.
Currently the UI has not been changed, so the only way to access rectangle maps right now is to use scripting and invoke the game action with your own width and height.