Skip to content

preserve-rooms: hangs if there is a cycle in entity position "replaced-by" definitions #5538

@ab9rf

Description

@ab9rf

The preserve-rooms tool will hang during fortress startup in an infinite loop if there is a cycle in the "replaced-by" definitions of the fortress entity's position definitions, in plugins/lua/preserve-rooms.lua at lines 324-326:

            while parent.replaced_by ~= -1 do
                parent = positions[parent.replaced_by]
            end

We need to add some sort of protection so that this doesn't hang if the fortress entity has a cycle in its replaced-by definitions. The "Long Night" mod apparently defines positions such that there is a cycle. Whether this is a good idea or not isn't the point; we need to not hang even in the face of what may well be very poor decisions by a modder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions