1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

readded some spacing between nests if available

This commit is contained in:
Aaron Veden 2021-12-27 22:58:51 -08:00
parent ffa7f11db3
commit 342341bda3
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
3 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 2.1.0
Date: 27. 12. 2021
Improvements:
- re-added finding non-colliding position for enemy structures but if it can't find a position then overlap them
---------------------------------------------------------------------------------------------------
Version: 2.0.4
Date: 17. 12. 2021

View File

@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "1.1",
"version" : "2.0.4",
"version" : "2.1.0",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",

View File

@ -8,9 +8,12 @@ local chunkProcessor = {}
local chunkUtils = require("ChunkUtils")
local queryUtils = require("QueryUtils")
local mapUtils = require("MapUtils")
local constants = require("Constants")
-- constants
local CHUNK_SIZE = constants.CHUNK_SIZE
-- imported functions
local removeChunkFromMap = mapUtils.removeChunkFromMap
@ -152,8 +155,9 @@ function chunkProcessor.processPendingUpgrades(universe, tick)
local surface = entity.surface
local query = universe.ppuUpgradeEntityQuery
local position = entityData.position or entity.position
setPositionInQuery(query, position)
query.name = entityData.name
local foundPosition = surface.find_non_colliding_position(entityData.name, position, CHUNK_SIZE, 1, true)
setPositionInQuery(query, foundPosition or position)
unregisterEnemyBaseStructure(entityData.map, entity, nil, true)
entity.destroy()
local createdEntity = surface.create_entity(query)