AAI Vehicles: Miner


A set of mining and excavation vehicles that can quickly mine solid resources such as coal, stone, ores, etc. They also harvest any trees in their path (and can consume the wood as fuel). The miners can be used standalone, or and can act autonomously if programmed with the AAI Programmable Vehicles mod.

Content
5 days ago
0.14 - 2.0
170K
Transportation Mining

b [0.3.3] Resource amount has to be greater than 0.

6 years ago

Hi all,

On random spots, mining non-unlimited Saphirite and Bobmonium, perhaps on all resources, the following error appears:

Notice
Error while running event aai-vehicles-miner::on_tick(ID 0)
Resource amount has to be greater than 0.
stack traceback:
[]aai-vehicles-miner/control.lua:445: in function 'mine_resource'
[]aai-vehicles-miner/control.lua:524: in function 'mine_area'
[]aai-vehicles-miner/control.lua:655: in function <_aai-vehicles-miner__/control.lua:631>

Lines 444-446:
if amount_remaining > 0 then
resource.amount = amount_remaining
else

It looks almost impossible for this to happen, but still it does..

6 years ago

Aparently it happens, because "resource.amount = amount_remaining" gets rounded down.
This means that if amount_remaining is a number between 0 and 1 (i.e. 0.95) it tries to set a 0, which then fails.

Attempting fix, testing out now:

Replace
if amount_remaining > 0 then

With
if amount_remaining >= 1 then

6 years ago

Seems to work, hope you can make an official update soon

6 years ago

This should be fixed now, thanks.