Skip to content

Block pasted moveables in flipped rooms#1206

Open
Copilot wants to merge 9 commits into
developfrom
copilot/fix-pasting-moveable-in-flipped-room
Open

Block pasted moveables in flipped rooms#1206
Copilot wants to merge 9 commits into
developfrom
copilot/fix-pasting-moveable-in-flipped-room

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

Pasting a moveable into a flipped room bypassed the existing placement restriction and warning shown by manual item placement. This change routes pasted objects through the same flipped-room validation so moveables are rejected consistently while statics remain allowed.

  • Placement validation

    • Added a flipped-room placement guard in EditorActions.PlaceObject(...), the shared path used by object placement and object paste.
    • The guard rejects placement only when the target room is the flipped variant (room.IsAlternate).
  • Moveables vs. statics

    • Detects moveable items directly via ItemInstance.
    • Preserves existing behavior for statics by only blocking non-static items.
  • Grouped paste handling

    • Handles multi-object pastes by checking ObjectGroup contents.
    • Rejects the whole paste if any pasted object in the group is a moveable.
  • User-facing behavior

    • Reuses the existing warning text instead of introducing a second variant:
      • You can't add moveables to a flipped room.
private static bool IsInvalidMoveablePlacement(Room room, ObjectInstance instance)
{
    if (!room.IsAlternate)
        return false;

    if (instance is ObjectGroup group)
        return ObjectGroupContainsMoveable(group);

    return ObjectInstanceIsMoveable(instance);
}

Copilot AI and others added 8 commits April 20, 2026 07:45
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/ce7180ba-fb5c-4625-b6b6-eef475b1308f

Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/ce7180ba-fb5c-4625-b6b6-eef475b1308f

Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/ce7180ba-fb5c-4625-b6b6-eef475b1308f

Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/ce7180ba-fb5c-4625-b6b6-eef475b1308f

Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/ce7180ba-fb5c-4625-b6b6-eef475b1308f

Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/ce7180ba-fb5c-4625-b6b6-eef475b1308f

Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/ce7180ba-fb5c-4625-b6b6-eef475b1308f

Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with pasting moveable in flipped room without warning Block pasted moveables in flipped rooms Apr 20, 2026
Copilot AI requested a review from Nickelony April 20, 2026 07:54
@Nickelony Nickelony marked this pull request as ready for review April 20, 2026 08:09
@Nickelony Nickelony added bug Something isn't working as intended. ready for review The Pull Request is finished and ready for review. labels Apr 20, 2026
@Nickelony Nickelony added this to the Version 2.0 milestone Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as intended. ready for review The Pull Request is finished and ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TE: Copying and pasting a moveable into a flipped room is possible and doesn't give a warning hint

2 participants