Issue
- when iterating items of an upgrade planner get_mapper() produces output not acceptable by set_mapper() most of the time.
- get_mapper() always returns a table, even if the entry is empty.
- type is always set, even if the entry is empty.
- module_limit is always set, even on unsupported items and even if the checkmark is unset.
- module_slots is always set, even on unsupported entities and even if the checkmark is unset.
- module_slots is not allowed to be an empty table, even when all module slots should be emptied.
- indices in module_slots do not match the configuration if prior module slots are empty.
- set_mapper() only accepts entities and modules, failing for everything else like fuels and meta items.
- set_mapper() for records in a shelf has been overwritten with get_mapper().
How to reproduce
- import this upgrade planner. currently affected by viewtopic.php?p=666798#p666798
Code: Select all
0eNq9ll1u4yAQx+/CcyzFdpMmftiLVFFFyDhFhYHFQ9Uo8gF6i33YvdieZCFumuaj/ki0fQMG/vPjbzOwZd6uHV/Bo1UcERwrtqwCIonrKrY1txZcaD5sWemMjmO0scAKJgk0GzHkOvagLKWQgGKTaLPyClg9YmS+nq8t7acmlTIUQj89V5I2Ieq4gzDQhB+V1JJYMf4YiPMj0yLkkLiC1xCsR12ErRk9CqO1wTAYGpY7Tia4wf6+/TmAlFJR49G7Jq8q0EsV3Eo0F08SIckvbeRE8jer2915F9jTHmsqWAOuuNucOZS2OZRe4dB/oZy1UWbfQTngv8o7eZwRz0BJ6UF1kKAXCrhrpvbzqpXtrpPNO47S613GRIA6TovGaa5Of88fHbu4pDkAehKhj+QBKfJ8JOBCeO3VDmeQ9PSCH23ih5X3fVaen/X0zKoei/IbK93sOtbsdlawUgxjnV/Hmt/OOuRIbQcWtLipgSs+1+FxD1Mqgni6nqCiL7d1cqn86jStj+iAj5tm9SJ0hMHGxEquMZSTw+24VB6sk0jJ0phn9vkq2snEslLsXyDJ/gUyYoovQ4EsGDWgL+EBIsPNXEym2fxuPp9M0/t8ls3q+h+8VvoJ
- place it in the first slot of the game blueprints library.
- run this console command.
Code: Select all
/c local bp = game.blueprints[1] for n = 1,bp.mapper_count do for _,t in pairs{"from","to"} do bp.set_mapper(n,t,table.deepcopy(bp.get_mapper(n,t))) end end
- the supplied example save has the full planner already in the right spot.
- you only need to run the console command.
Expected result
- no errors.
- no changes to the planner.
Actual result
- almost every entry produces an error.
- module slots configuration for crafting machines get distorted.