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

Automatically update MAP_DYNAMIC if necessary #2069

Open
wants to merge 1 commit into
base: porymap-6
Choose a base branch
from

Conversation

GriffinRichards
Copy link
Member

At the moment, the 128th map in any map group will be treated as MAP_DYNAMIC because it's read using only MAP_NUM. Because MAP_DYNAMIC is in the middle of the map value range we can alleviate this problem a little by automatically increasing its value if there are sufficient maps in any map group. Although MAP_GROUP isn't used in isolation to read MAP_DYNAMIC, we can do the same if there are sufficient map groups just in case. MAP_UNDEFINED is read with MAP_GROUP in isolation, but it's already at the end of the value range.

Also added error messages to mapjson if the number of maps or map groups exceeds the value range (including the space reserved for MAP_DYNAMIC and MAP_UNDEFINED). Frustratingly the data type for map groups / map numbers is treated inconsistently and sometimes uses s8, so although these values are allowed to reach 255, there can be value range errors for values > 127. This problem is left unchanged by this PR.

This is targeting the porymap-6 branch for now because at the moment Porymap is (unnecessarily) overwriting the map_groups.h file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant