From 02a418957e7a9e0801674c201b01022ad558f11f Mon Sep 17 00:00:00 2001 From: Klemen Plestenjak Date: Mon, 12 Feb 2024 18:47:12 +0100 Subject: [PATCH] Fix bug with unit recruitment --- game/main.c | 4 ++-- game/systems/s_entity.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/game/main.c b/game/main.c index 1690366..53d9867 100644 --- a/game/main.c +++ b/game/main.c @@ -898,9 +898,9 @@ void imguiRender(float dt, void *userData) { resources.wood = wood; resources.food = food; resources.gold = gold; - game->playerResources[game->player] = resources; + //game->playerResources[game->player] = resources; igText("Pop: %lld", resources.pop); - igText("Pop Capacity: %lld", resources.pop); + igText("Pop Capacity: %lld", resources.popCapacity); } if (igCollapsingHeader_TreeNodeFlags("BuildMenu", 0)) { for (int i = BUILDING_NONE; i < BUILDING_COUNT; i++) { diff --git a/game/systems/s_entity.c b/game/systems/s_entity.c index 67adf54..02c5e21 100644 --- a/game/systems/s_entity.c +++ b/game/systems/s_entity.c @@ -397,12 +397,12 @@ void updateBuildingRecruitment(ecs_iter_t *it) { Player player = owner[i].player; Vector2 placePos = { (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.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]; if (slot->numRecruiting <= 0) continue;