Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

Remaining mineable asteroids calculated incorrectly for respawn mechanic


Graendal
 Share

Recommended Posts

From the scripts/sector/background/respawnresourceasteroids.lua:

function RespawnResourceAsteroids.respawnRichAsteroids()
    local sector = Sector()
    local richAsteroids = sector:getNumEntitiesByComponent(ComponentType.MineableMaterial)
    local numAsteroids = sector:getNumEntitiesByType(EntityType.Asteroid)

    if numAsteroids == 0 then return end
    if richAsteroids / numAsteroids > self.respawningThreshold then return end

    ...
end

Correct me if I'm wrong, but it looks like the line

local richAsteroids = sector:getNumEntitiesByComponent(ComponentType.MineableMaterial)

includes wreckages in the total number of rich asteroids because wreckages also have the component type of 'MineableMaterial'.  I'm thinking the fix is as easy as:

local richAsteroids = sector:getNumEntitiesByComponent(ComponentType.MineableMaterial) - sector:getNumEntitiesByType(EntityType.Wreckage)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...