From 88d5c1f65d310753c99993b7629cd91c9569e4b7 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 4 Dec 2021 16:23:42 -0800 Subject: [PATCH] fixed kastorio creep spawn on failed upgrade --- changelog.txt | 1 + libs/ChunkProcessor.lua | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 2855a85..0ffce92 100644 --- a/changelog.txt +++ b/changelog.txt @@ -41,6 +41,7 @@ Date: 23. 11. 2021 - Fixed enemy structures destroyed by the enemy were not being unregistered from Rampants map - Fixed regional bases would not be corrected distributed or cleaned up on spawners - Fixed chunks that became impassable would not return an impassable chunk flag when pass scanned + - Fixed kastorio creep code be spawned when the building failed to upgrade Framework: - Fixed Rampant in-memory map visualization tool for debugging - Added debug mod settings for showing enemy structures being upgraded in place diff --git a/libs/ChunkProcessor.lua b/libs/ChunkProcessor.lua index b07121d..5f16d2a 100644 --- a/libs/ChunkProcessor.lua +++ b/libs/ChunkProcessor.lua @@ -149,12 +149,12 @@ function chunkProcessor.processPendingUpgrades(map, tick) local surface = entity.surface unregisterEnemyBaseStructure(map, entity) entity.destroy() - if remote.interfaces["kr-creep"] then - remote.call("kr-creep", "spawn_creep_at_position", surface, query.position) - end local createdEntity = surface.create_entity(query) if createdEntity and createdEntity.valid then registerEnemyBaseStructure(map, createdEntity, tick, entityData.base) + if remote.interfaces["kr-creep"] then + remote.call("kr-creep", "spawn_creep_at_position", surface, query.position) + end end else map.pendingUpgradeIterator = next(pendingUpgrades, entity)