I figured out the bug. As I had suspected, it was stupidly simple. I was immediately overwriting the saved map with the saved game variables. That explains the mysterious sequence of numbers. I don’t know how I thought that would work: writing, not appending, different information to the same file.
The next problem was that the special object array wasn’t being regenerated correctly. That was another easy problem, as I had simply neglected to make a function call.
I’ve had trouble working from someone else’s code. At least these problems are fixed now, and I like to think I’m getting the hang of it. I’m happy the problem wasn’t a fundamental misunderstanding of C on my part. I still don’t understand why the special object array exists in the first place.
I’ve also added pausing, and plan to work on the difficulty curve, customizable key bindings, a main menu, general code cleanup, and smoothing out the rough edges in the UI.