Fix incorrect ending offsets for looping chunks

This commit is contained in:
Jarrod Doyle 2024-08-23 12:08:57 +01:00
parent 1979d85f58
commit b17ecb3f3d
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
3 changed files with 6 additions and 3 deletions

View File

@ -9,7 +9,8 @@ using BrMedia;
using BrType;
struct BrList {
Br brushes[while($ < brlist_toc.offset + brlist_toc.size)];
u32 max = get_end(toc, parent.header.name);
Br brushes[while($ < max)];
};
// There's one core struct here, but fields are used differently for non-terrain brushes

View File

@ -9,5 +9,6 @@ struct ObjMapElement {
};
struct ObjMap {
ObjMapElement objects[while($ < objmap_toc.offset + objmap_toc.size)];
u32 max = get_end(toc, parent.header.name);
ObjMapElement objects[while($ < max)];
};

View File

@ -9,6 +9,7 @@ namespace ScrModules {
};
struct ChunkData {
Name names[while($ < scrmodules_toc.offset + scrmodules_toc.size)];
u32 max = get_end(toc, parent.header.name);
Name names[while($ < max)];
};
}