Page 1 of 1

[1.1.107] Game hangs when an item's burnt result is set to itself

Posted: Wed May 15, 2024 2:38 pm
by curiosity
Steps to reproduce:
1. Execute the following line in data stage:

Code: Select all

data.raw.item['uranium-fuel-cell'].burnt_result = 'uranium-fuel-cell'
2. Start a new map.
3. Observe that the game hangs on map load.

Expected behavior:
Either the game can be played normally and the item produces itself when burnt, or a prototype error is produced on startup.

Re: [1.1.107] Game hangs when an item's burnt result is set to itself

Posted: Wed May 15, 2024 2:56 pm
by curiosity
Paradoxically, the game works fine if I define a new item like so:

Code: Select all

data:extend{
    {
        type = 'item',
        name = 'fancy-new-item',
        icon = "__base__/graphics/icons/crash-site-spaceship-wreck-big-1.png",
        icon_size = 64, icon_mipmaps = 4,
        stack_size = 100,
        fuel_category = 'nuclear',
        fuel_value = '4MJ',
        burnt_result = 'fancy-new-item',
    },
}
And the burnt result works as expected.

Re: [1.1.107] Game hangs when an item's burnt result is set to itself

Posted: Wed May 15, 2024 3:03 pm
by curiosity
Related: viewtopic.php?f=35&t=113120
The code from that report also causes this bug.

Re: [1.1.107] Game hangs when an item's burnt result is set to itself

Posted: Wed May 15, 2024 5:19 pm
by Rseding91
Thanks for the report. The key part I missed with the other bug report is the freeze happens when generating/loading a map. I do not have menu simulations enabled so the game would always load to the main menu for me. For the other report it would freeze as soon as it would try to load the first menu simulation.

I can reproduce the freeze when generating a new map and it has already been fixed for 2.0 as part of some refactoring.