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 bug MapGen may generate a collision plane having (NaN, NaN, NaN, NaN) #1118

Merged
merged 2 commits into from
Sep 29, 2024

Conversation

kenjiuno
Copy link
Collaborator

Oathseeker reported that a problematic map generated by MapGen will cause at least 2 problems:

  • This causes an indeterminate crash on the KH2 PC with a playing on the problematic map loaded.
  • Kh2MapStudio will crash if we turn on the Show map collisions option after loading the problematic map.

Fix bug MapGen may generate a collision plane having (NaN, NaN, NaN, NaN)

Co3[1134] 0 0 PolyCo4( 825, 826, 810, -1) PlaneCo5(913) Co6(968) Co7( 0)

Co4[825] X:2200 Y:0.0003623899 Z:-2400 W:1
Co4[826] X:2100 Y:0.0003623899 Z:-2400 W:1
Co4[810] X:2050 Y:0.0003623899 Z:-2400 W:1

Co5[913] Normal:X:NaN Y:NaN Z:NaN D:NaN

According to Bing Copilot, the plane cannot be built from these 3 3D coordinates. Thus skip the invalid plane instead of including it.

2024-09-30_01h42_16

Copy link
Collaborator

@Oathseeker Oathseeker left a comment

Choose a reason for hiding this comment

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

I can confirm this fixes the issue with the collision generated in a custom map, thanks Kenji!

@Oathseeker Oathseeker merged commit 96d498f into OpenKH:master Sep 29, 2024
3 checks passed
@kenjiuno kenjiuno deleted the fix-mapgen-nan branch September 30, 2024 00:05
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.

2 participants