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

Incorrect parsing on dragonisland.zen #44

Closed
Try opened this issue Dec 19, 2022 · 2 comments
Closed

Incorrect parsing on dragonisland.zen #44

Try opened this issue Dec 19, 2022 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Try
Copy link
Contributor

Try commented Dec 19, 2022

Hi, I've found an issue with level parsing. Offended object:
изображение
This is invisible ore nugget, that triggers the big bridge, after fire-dragon. focus_override is needed, so player can aim it with bow.

focus_override value is wrongly false, with current main branch.
When debugging locally, I've found that problem is in read_bool routine:

bool archive_reader_binsafe::read_bool() {
	ensure_entry_meta(bs_bool);
-	return input.get_uint() != 1;
+	return input.get_uint() != 0;
	}

Proposed change is to replace all read_bool variants with !=0 - what is similar to how code would behave, if original game uses implicit case.

@lmichaelis lmichaelis self-assigned this Dec 19, 2022
@lmichaelis lmichaelis added the bug Something isn't working label Dec 19, 2022
@lmichaelis lmichaelis added this to the v1.1.0 milestone Dec 19, 2022
@lmichaelis
Copy link
Member

You're right, != is the correct way to check for bools here. Though it having a value other than 0 or 1 seems weird. If I remember correctly, the original code does just writes 0 or 1 into archives so this might be an indication of focusOverride being an enum instead. I'll investigate that later though :)

@lmichaelis lmichaelis added the awaiting verification The problem has been fixed, though external verification of this fix is required label Dec 19, 2022
@Try
Copy link
Contributor Author

Try commented Dec 20, 2022

Tested in OpenGothic - gameplay problem fixed, thanks!

@lmichaelis lmichaelis removed the awaiting verification The problem has been fixed, though external verification of this fix is required label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants