Fixed asset header compare incosistenty

This commit is contained in:
2025-11-09 10:24:45 -06:00
parent 5a3004f1d1
commit eff5fc3d9a
3 changed files with 15 additions and 2 deletions

View File

@@ -64,7 +64,17 @@ errorret_t assetLoad(const char_t *filename, void *output) {
for(uint_fast8_t i = 0; i < ASSET_TYPE_COUNT; i++) {
const assettypedef_t *cmp = &ASSET_TYPE_DEFINITIONS[i];
if(cmp->header == NULL) continue;
if(strcmp(header.header, cmp->header) != 0) continue;
// strcmp didn't work because it's a fixed char_t[3] I think, or maybe
// because of the packed struct?
bool_t match = true;
for(size_t h = 0; h < ASSET_HEADER_SIZE; h++) {
if(header.header[h] == cmp->header[h]) continue;
match = false;
break;
}
if(!match) continue;
def = cmp;
break;
}