I can’t seem to get the “immediately undo rule” to work for me. Here’s my sample:
Room1 is a room. "This is room 1.".
Room2 is west of Room1. "This is room 2.".
player is in Room1.
newundoing is an action out of world.
understand "newundo" as newundoing.
carry out newundoing:
follow the immediately undo rule.
“undo” behaves normally. “newundo” only pretends that it did something:
Room1
This is room 1.
>w
Room2
This is room 2.
>undo
Room1
[Previous turn undone.]
>w
Room2
This is room 2.
>newundo
Room2
[Previous turn undone.]
>newundo
Room2
[Previous turn undone.]
>newundo
Room2
[Previous turn undone.]
I believe the problem is that it creates the undo state right before parsing and executing the action, so when you jump back to that undo state, you’ve only undone the action of newundoing. This is why UNDO isn’t an action normally (like AGAIN and OOPS, it happens outside of the action machinery).