From 1413beea3b506b15b9f0080cec29c745d1ef88da Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 8 Jan 2025 13:52:22 +0100 Subject: pooling fix --- game/enemy/EnemyPool.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'game/enemy/EnemyPool.cpp') diff --git a/game/enemy/EnemyPool.cpp b/game/enemy/EnemyPool.cpp index b5160db..50d0e6a 100644 --- a/game/enemy/EnemyPool.cpp +++ b/game/enemy/EnemyPool.cpp @@ -3,5 +3,8 @@ using namespace std; void EnemyPool::create_enemies(crepe::Scene & scn) { EnemySubScene enemy; - while(enemy.create(scn) < this->MAXIMUM_AMOUNT); + int amount = 0; + while (amount < this->MAXIMUM_AMOUNT) { + amount = enemy.create(scn, amount); + } } -- cgit v1.2.3