Correctly populate Unit struct when creating entities
This commit is contained in:
@@ -65,9 +65,11 @@ ecs_entity_t entityCreateBaseUnit(const Position position, f32 size, Player play
|
||||
.deceleration = 0.1f,
|
||||
.unitType = type
|
||||
};
|
||||
if (unit)
|
||||
unitComp = *unit;
|
||||
ecs_set_ptr(ECS, e, Unit, &unitComp);
|
||||
if (unit) {
|
||||
*unit = unitComp;
|
||||
} else {
|
||||
ecs_set_ptr(ECS, e, Unit, &unitComp);
|
||||
}
|
||||
ecs_set(ECS, e, ConsumePopCapacity, {1});
|
||||
return e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user