Skip to content

Conversation

twise2
Copy link

@twise2 twise2 commented Apr 17, 2025

Tech tree errors when trying to write an int 8

Tech tree errors when trying to write an int 8
@twise2
Copy link
Author

twise2 commented Apr 17, 2025

image

vs

image

@twise2 twise2 changed the title Fix int_8 error on write Fix "overflow error: int too big to convert error" Apr 17, 2025
@HSZemi
Copy link
Member

HSZemi commented Apr 17, 2025

Uhhhh… Well the error message is correct. You simply can't have more than 255 unit connections in the tech tree section of the dat file. That field may be a int16_t for Star Wars: Galactic Battleground, but it's a uint8_t otherwise:
https://github.com/Tapsa/genieutils/blob/4b454e5b9f26a240078bb6a5c2bd3f514b3dc94b/src/dat/TechTree.cpp#L73

I think the tech tree section of the dat file is not used by AoE2 DE anyway? Not sure. In any case, your "fix" sadly only breaks the file format 🥲

@twise2
Copy link
Author

twise2 commented Apr 17, 2025

hmm, you appear to be correct as usual.

If that's the case it may be worth pulling the file entirely. It's throwing me off a bit still because the length before I am appending appears to be length appears to be 290 before the overflow is caused.

@twise2 twise2 closed this Apr 17, 2025
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