ID:2880123
 
Resolved
Defloating selections in the map editor could corrupt the undo stack, leading to crashes and other odd behavior.
BYOND Version:515.1609
Operating System:Windows 10 Home 64-bit
Web Browser:
Applies to:Dream Maker
Status: Resolved (515.1610)

This issue has been resolved.
This is a separate thread for a bug reported by HindyMinte ( https://www.byond.com/forum/post/2877188 ). The attached videos in the original thread are illustrative.

Descriptive Problem Summary:
Continuously cutting things will inevitably skip registering some of those actions, resulting in being unable to undo them.

Numbered Steps to Reproduce Problem:
1. Select an area of the map
2. Cut it
3. Repeat several times times
4. Try to Undo all of that
Another report in the thread points that
"Continously copying and pasting things will inevitably skip registering some of those actions, resulting in being unable to undo them."

But I believe it's the same bug.
I followed the same instructions but still couldn't reproduce this. It would help to have a small test project and a very specific set of steps (right down to what pieces to cut and in what order).
I've tested and confirmed that with a clear test project that consisted of:
world/turf = /turf/black

/turf
icon = 'turf.dmi'
floor
icon_state = "floor"
black
icon_state = "black"

And a 50x50x1 map filled with /turf/floor. Nothing else.

So it's safe to say that it will happen regardless of the map and specific game.
Which tiles are selected seems to have no effect.

Step to reproduce:
1. Select a large region (4x4+ )
2. Cut
3. Select another large region that overlaps the previously cut one
4. Cut
5. Repeat 3-4
6. Undo all actions
7. Repeat 1-6 until map corrupts (rarely takes more than 5 attempts)

Sometimes it corrupts the map, sometimes not. Even with the same chain of actions and same regions being selected.

That's as good as it gets with debugging a closed software with no tools or access to internal workings.
The steps are still pretty vague in terms of how to reliably cause this. You say it takes multiple attempts at this, but there isn't a specific number.
Like I said, it rarely takes more than 5 attempts, but that's not guaranteed. The corruption seem to happen at random. The steps are clear enough the video posted by HindyMinte. Same happens with any maps and assets.

I took the time to test it in a clean project, it happened a lot, but at the same time I did not find any set of actions that caused it reliably.
After doing some testing, the undo history seems to be corrupted by any action that changes turfs. Not just cutting/copying & pasting.


Barebones test project (Has two turfs, their icon file & two maps):
https://cdn.discordapp.com/attachments/860222774877618229/ 1132948717947846746/cut_test.zip

To reproduce:
1.open map.dmm or map2.dmm
2. Select one of the colors and cut/move/copy it into the other color.
3. Do this 3-6 times.
4. Try and undo everything.

Something to note is that the unsaved changes star in the maps file name disappears at the moment of corruption, even when there are still changes to the map.
Dream maker also seems to sometimes crash completely when trying to redo actions after the action history becomes corrupted. I couldn't reproduce it reliably though.
In response to Aregrued
Aregrued wrote:
Dream maker also seems to sometimes crash completely when trying to redo actions after the action history becomes corrupted. I couldn't reproduce it reliably though.

I ran into this tonight and lost 3 hours of work that I stupidly hadn't saved.

The steps I took that caused the crash:

1) I copied a palette blank out of another DMM file.
2) I pasted it into my working DM file.
3) Because DM doesn't change to the selection tool when you paste something, I wound up drawing a line of turfs over the top of what I just pasted, instead of dragging it.
4) I pressed undo. Nothing happened.
5) I pressed undo. Nothing happened.
6) I pressed undo. Nothing happened.
7) I realized that I had actually been undoing work from before the paste action but the thing that should have been undone was skipped over somehow, so I pressed redo.
8) I witnessed my desktop.
I was able to reproduce this including the crash, although it's gonna be a bitch to figure out. I'm not sure if the copy+paste issue fully matches the cut issue, but I suspect solving the one I could reproduce will shine a light on all the others if they're not the same bug.
Lummox JR resolved issue with message:
Defloating selections in the map editor could corrupt the undo stack, leading to crashes and other odd behavior.