aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-09-21 09:16:10 -1030
committermat <git@matdoes.dev>2025-09-21 11:46:13 -0800
commitaefa908e32032616cb356e7f4165cbb8922edbcf (patch)
tree2c15096917c009b9fd823e7d57894382904f7951 /codegen/lib/code
parentf049eee0496083fe6347e2f4a4f7b8e4512883ee (diff)
downloadazalea-drasl-aefa908e32032616cb356e7f4165cbb8922edbcf.tar.xz
fix pickable entity query
Diffstat (limited to 'codegen/lib/code')
-rw-r--r--codegen/lib/code/entity.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/codegen/lib/code/entity.py b/codegen/lib/code/entity.py
index 31cf71a8..eb2677ad 100644
--- a/codegen/lib/code/entity.py
+++ b/codegen/lib/code/entity.py
@@ -262,14 +262,16 @@ impl From<EntityDataValue> for UpdateMetadataError {
metadata_type_data = metadata_types[type_id]
rust_type = metadata_type_data["type"]
- code.append("#[derive(Component, Deref, DerefMut, Clone)]")
+ code.append("#[derive(Component, Deref, DerefMut, Clone, PartialEq)]")
code.append(f"pub struct {struct_name}(pub {rust_type});")
else:
# if it's a bitfield just make a struct for each bit
for mask, name in name_or_bitfield.items():
name = maybe_rename_field(name, index)
struct_name = upper_first_letter(to_camel_case(name))
- code.append("#[derive(Component, Deref, DerefMut, Clone, Copy)]")
+ code.append(
+ "#[derive(Component, Deref, DerefMut, Clone, Copy, PartialEq)]"
+ )
code.append(f"pub struct {struct_name}(pub bool);")
# add the entity struct and Bundle struct