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

Fix: hanging when loading Val-loca.lua #178

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

entrez
Copy link
Contributor

@entrez entrez commented Jun 9, 2023

This level tries to generate a clear path through the ice on the left
hand side of the screen, which involves retrieving the name of the
terrain type and comparing it against a list of allowed types. However,
the array of terrain type names had desynced from the actual list of
terrain types, causing it to produce the wrong names so that it would
never actually certify the path as "good to go". Fix this by
resynchronizing the lists, and add an explicit length to the terrain
type names list based on the enum so that it will produce a compiler
error if more terrains are added in the future without fixing the
terrain name list.

This level tries to generate a clear path through the ice on the left
hand side of the screen, which involves retrieving the name of the
terrain type and comparing it against a list of allowed types.  However,
the array of terrain type names had desynced from the actual list of
terrain types, causing it to produce the wrong names so that it would
never actually certify the path as "good to go".  Fix this by
resynchronizing the lists, and add an explicit length to the terrain
type names list based on the enum so that it will produce a compiler
error if more terrains are added in the future without fixing the
terrain name list.
@entrez
Copy link
Contributor Author

entrez commented Jun 9, 2023

This was an outstanding xnh issue (sorta) with the addition of GRASS and
MAGIC_PLATFORM but it didn't really affect anything since they are at the end
of the list. It was only when LAVAWALL was added in the middle without fixing
levltyp[] (in vanilla) that everything got shifted over and this became a
problem. I opened an equivalent vanilla PR too (NetHack/NetHack#1052) since
it needs it, but this one contains the xnh-specific descriptions of GRASS and
MAGIC_PLATFORM as well.

@copperwater copperwater merged commit 171fa8a into copperwater:master Jun 9, 2023
3 checks passed
@entrez entrez deleted the fix-Val-loca-hang branch June 9, 2023 13:41
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.

None yet

2 participants