Avoid stale room ownership when pasting copied objects#1209
Conversation
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/95d6c9ac-8ca4-475a-97ad-50ef9cc4f33f Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
|
@copilot Would you be able to provide reproduction steps for the original issue? What do we have to do in order to get the original error before the fix was applied? Also, please double-check that the changes don't cause any regressions for other places in the code. |
I could not get a 100% deterministic UI repro in this Linux sandbox, but the pre-fix failure mode is clear:
Before the fix, that method temporarily added the clipboard instance to I also re-checked regressions for the current change:
|
Rare object paste operations in Tomb Editor could fail with an "object already belongs to another room" exception, after which the paste would effectively behave like a move. This comes from collision checks mutating room ownership on the clipboard instance during paste preparation.
ObjectClipboardData: stop mutating room ownership during paste preparationAddObject/RemoveObjectprobe used inMergeGetSingleObject().SelectedRoom.Identifier collision handling
editor.Level.GlobalScriptingIdsTable.IHasLuaName.Result