GothicKit / ZenKit

A re-implementation of file formats used by the early 2000's ZenGin

Home Page:http://zk.gothickit.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect parsing on dragonisland.zen

Try opened this issue · comments

commented

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.

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 :)

commented

Tested in OpenGothic - gameplay problem fixed, thanks!