Fix bug with unit recruitment
This commit is contained in:
@@ -898,9 +898,9 @@ void imguiRender(float dt, void *userData) {
|
|||||||
resources.wood = wood;
|
resources.wood = wood;
|
||||||
resources.food = food;
|
resources.food = food;
|
||||||
resources.gold = gold;
|
resources.gold = gold;
|
||||||
game->playerResources[game->player] = resources;
|
//game->playerResources[game->player] = resources;
|
||||||
igText("Pop: %lld", resources.pop);
|
igText("Pop: %lld", resources.pop);
|
||||||
igText("Pop Capacity: %lld", resources.pop);
|
igText("Pop Capacity: %lld", resources.popCapacity);
|
||||||
}
|
}
|
||||||
if (igCollapsingHeader_TreeNodeFlags("BuildMenu", 0)) {
|
if (igCollapsingHeader_TreeNodeFlags("BuildMenu", 0)) {
|
||||||
for (int i = BUILDING_NONE; i < BUILDING_COUNT; i++) {
|
for (int i = BUILDING_NONE; i < BUILDING_COUNT; i++) {
|
||||||
|
|||||||
@@ -397,12 +397,12 @@ void updateBuildingRecruitment(ecs_iter_t *it) {
|
|||||||
Player player = owner[i].player;
|
Player player = owner[i].player;
|
||||||
Vector2 placePos = {
|
Vector2 placePos = {
|
||||||
(building[i].pos.x + building[i].size.x * 0.5f) * 16.0f,
|
(building[i].pos.x + building[i].size.x * 0.5f) * 16.0f,
|
||||||
(building[i].pos.y + building->size.y + 0.5f) * 16.0f
|
(building[i].pos.y + building[i].size.y + 0.5f) * 16.0f
|
||||||
};
|
};
|
||||||
placePos.x += GetRandomValue(-building[i].size.x, building[i].size.x);
|
placePos.x += GetRandomValue(-building[i].size.x, building[i].size.x);
|
||||||
placePos.y += GetRandomValue(-4, 4);
|
placePos.y += GetRandomValue(-4, 4);
|
||||||
|
|
||||||
for (i32 slotIdx = 0; slotIdx < info[i].numSlots; i++) {
|
for (i32 slotIdx = 0; slotIdx < info[i].numSlots; slotIdx++) {
|
||||||
BuildingRecruitSlot *slot = &info[i].slots[slotIdx];
|
BuildingRecruitSlot *slot = &info[i].slots[slotIdx];
|
||||||
|
|
||||||
if (slot->numRecruiting <= 0) continue;
|
if (slot->numRecruiting <= 0) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user