ecs: check column type IDs before size/alignment
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
2115f5832a
commit
ce0b764a6d
1 changed files with 1 additions and 1 deletions
|
|
@ -161,9 +161,9 @@ pub fn setDynamic(storage: *Archetype, row_index: u32, name: StringTable.Index,
|
||||||
if (comp.is_debug) {
|
if (comp.is_debug) {
|
||||||
// TODO: improve error messages
|
// TODO: improve error messages
|
||||||
assert(storage.len != 0 and storage.len >= row_index);
|
assert(storage.len != 0 and storage.len >= row_index);
|
||||||
|
assert(storage.columnByName(name).?.type_id == type_id);
|
||||||
assert(storage.columnByName(name).?.size == component.len);
|
assert(storage.columnByName(name).?.size == component.len);
|
||||||
assert(storage.columnByName(name).?.alignment == alignment);
|
assert(storage.columnByName(name).?.alignment == alignment);
|
||||||
assert(storage.columnByName(name).?.type_id == type_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const values = storage.getColumnValuesRaw(name) orelse @panic("no such component");
|
const values = storage.getColumnValuesRaw(name) orelse @panic("no such component");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue