[1.1.56] Removal/Error of autoplace_specification field from tree LuaEntityPrototype's

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

[1.1.56] Removal/Error of autoplace_specification field from tree LuaEntityPrototype's

Post by Muppet9010 »

In 1.1.55 and before you could obtain the the autoplace_specification from a tree LuaEntityPrototype, but in 1.1.56 this isn't obtainable and it isn't listed as an intentional loss in the 1.1.56 changelog. its also still in current documentation.
https://lua-api.factorio.com/latest/Lua ... cification

Prototypes being obtained via the below snippet:

Code: Select all

game.get_filtered_entity_prototypes({{filter = "type", type = "tree"}, {mode = "and", filter = "autoplace"}})

EDIT: on trying more code I think its an internal Factorio error on trying to get the autoplace_specification. As I get the below error when I try to check if autoplace_specifiation is nil:

Code: Select all

Value can't be NaN. in property tree at ROOT.coverage

Code: Select all

local treeEntities = game.get_filtered_entity_prototypes({{filter = "type", type = "tree"}, {mode = "and", filter = "autoplace"}})
for _, prototype in pairs(treeEntities) do
    if prototype.autoplace_specification ~= nil and prototype.autoplace_specification.peaks ~= nil then
        log(prototype.name)
    end
end

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.56] Removal/Error of autoplace_specification field from tree LuaEntityPrototype's

Post by Rseding91 »

Thanks for the report. This is fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”