Skip to content

Fix editor getting stuck in PAINT mode when unsupported entity is placed - #274

Open
koenigstag wants to merge 5 commits into
teoxoy:masterfrom
koenigstag:claude/factorio-blueprint-editor-bugs-c9d9of
Open

Fix editor getting stuck in PAINT mode when unsupported entity is placed#274
koenigstag wants to merge 5 commits into
teoxoy:masterfrom
koenigstag:claude/factorio-blueprint-editor-bugs-c9d9of

Conversation

@koenigstag

Copy link
Copy Markdown

No description provided.

claude added 5 commits August 10, 2026 03:50
spawnPaintContainer() switched EditorMode to PAINT before constructing
the PaintContainer subclass. If construction threw (e.g. for entities
whose sprite drawing or item lookup isn't implemented, such as
elevated rails), the mode stayed stuck at PAINT with no paint
container attached, and buildStart()'s `mode !== PAINT` guard would
never trip again — blocking placement of any entity afterwards until
a full page reload.

Now construction happens inside a try/catch and the mode is only
flipped to PAINT after it succeeds, so a failing item just logs a
warning instead of wedging the tool.
Falls back to the generic "Could not place this item." warning for
any other unexpected failure, keeping the raw error in the console
for debugging.
…prites

Only the first transport-belt-textured sprite in these entities' part
list was ever assigned a __zIndex; every other part (including the
structure/structure_patch graphics) was left undefined. Since
EntitySprite.compareFn subtracts __zIndex values to sort the global
sprite list, an undefined operand produced NaN, making sort order for
these parts unstable relative to neighboring entities.

Give __zIndex a default of 0 and assign all belt-textured parts of
splitter/underground-belt/loader a defined value (-6 for the first,
-5 for the rest, matching the plain transport-belt branch), with
other parts falling back to 0.
entity.station is undefined on a freshly placed train stop, so the
DOM text input rendered the literal string "undefined". Default to
an empty string instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants