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,
|
.deceleration = 0.1f,
|
||||||
.unitType = type
|
.unitType = type
|
||||||
};
|
};
|
||||||
if (unit)
|
if (unit) {
|
||||||
unitComp = *unit;
|
*unit = unitComp;
|
||||||
|
} else {
|
||||||
ecs_set_ptr(ECS, e, Unit, &unitComp);
|
ecs_set_ptr(ECS, e, Unit, &unitComp);
|
||||||
|
}
|
||||||
ecs_set(ECS, e, ConsumePopCapacity, {1});
|
ecs_set(ECS, e, ConsumePopCapacity, {1});
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user