diff --git a/feely_pona.cpp b/feely_pona.cpp index ca974fa..a2020cb 100644 --- a/feely_pona.cpp +++ b/feely_pona.cpp @@ -1987,7 +1987,14 @@ static void FP_Update(TELY_OS *os, FP_Game *game, TELY_OSInput *input, TELY_Audi Dqn_usize enemy_count = 0; for (FP_GameEntityHandle spawner_handle : game->play.mob_spawners) { FP_GameEntity *spawner = FP_Game_GetEntity(game, spawner_handle); - enemy_count += spawner->spawn_list.size; + + // NOTE: Count all the mobs spawned that are a foe + // (e.g. churches that convert mobs don't count). + for (FP_SentinelListLink *link = nullptr; FP_SentinelList_Iterate(&spawner->spawn_list, &link); ) { + FP_GameEntity *mob = FP_Game_GetEntity(game, link->data); + if (mob->faction == FP_GameEntityFaction_Foe) + enemy_count++; + } } bool all_enemies_killed = enemy_count == 0;