Upgrade Builder and Planner

by Roang

Automatically upgrade buildings by hand or with construction robots.

Utilities
3 years ago
0.17 - 1.1
18.6K

b Crash when updating blueprint book that contains upgrade/destruction planners

2 years ago

When trying to upgrade the 10 Books Full of Rails blueprint ( https://factorioprints.com/view/-MFIYLSH60wmZ-pNvcL_ ) to use the Space Exploration space rails and belts, I get a crash "Item is not blueprint"

The mod Upgrade Builder and Planner (2.2.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event upgrade-planner-next::on_gui_click (ID 1)
Item is not blueprint.
stack traceback:
[C]: in function 'is_blueprint_setup'
upgrade-planner-next/upgrade-planner/entity-upgrade.lua:407: in function 'update_blueprint_entities'
upgrade-planner-next/upgrade-planner/entity-upgrade.lua:496: in function 'handler'
stdlib/stdlib/event/event.lua:342: in function 'pcall'
stdlib/stdlib/event/event.lua:359: in function 'dispatch_event'
stdlib/stdlib/event/event.lua:438: in function <stdlib/stdlib/event/event.lua:396>

2 years ago
(updated 2 years ago)

I managed to fix it
Replace this (entity-upgrade.lua, line 405+):
local function update_blueprint_entities(stack, hashmap)
if not (stack and stack.valid and stack.valid_for_read and
stack.is_blueprint_setup()) then return end

with:
local function update_blueprint_entities(stack, hashmap)
if not (stack and stack.valid and stack.valid_for_read and stack.is_blueprint)
then if stack.is_blueprint_book then
local inventory = stack.get_inventory(defines.inventory.item_main)
local success = 0
for k = 1, #inventory do
if update_blueprint_entities(inventory[k], hashmap) then
success = success + 1
end
end
return
else return end
end
if not (stack.is_blueprint_setup()) then return end

5 months ago
(updated 5 months ago)

Can be removed

New response