Skip to content

Commit 037a8b2

Browse files
committed
fix(groups): exception now throws when one tries to add the same entity to two groups
1 parent e086c70 commit 037a8b2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

engine/modules/entities/src/main/java/com/codingame/gameengine/module/entities/ContainerBasedEntity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public void add(Entity<?>... entities) {
5151
throw new IllegalArgumentException();
5252
}
5353
this.entities.add(entity);
54+
entity.parent = this;
5455
});
5556

5657
set("children", asString(this.entities), null);

0 commit comments

Comments
 (0)