Erase undo stack when load a savegame
Moderator: Forum Moderators
Forum rules
Before reporting issues in this section, you must read the following topic:
Before reporting issues in this section, you must read the following topic:
Erase undo stack when load a savegame
I've tried putting all sorts of actions in a preload event, but whatever I do doesn't stop loading a savegame from undoing the last move before saving the save. Even if I create a unit and generate a random number, two actions that are not supposed to be undone. The unit is created but I can undo the last movement previously saved.
The question is, is it technically possible to cancel/avoid undoing when loading a savegame via a preload event or similar, which allows filtering conditions?
The goal is to avoid a crash when certain events that contain [on_undo] are executed. #7253
Code: Select all
[event]
name=preload
first_time_only=no
[filter_condition]
some conditions
[/filter_condition]
{VARIABLE_OP disallow_undo rand(0..1)}
{NAMED_GENERIC_UNIT 1 Peasant 1 1 dummy Dummy}
[/event]
The goal is to avoid a crash when certain events that contain [on_undo] are executed. #7253
- Pentarctagon
- Project Manager
- Posts: 5581
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Erase undo stack when load a savegame
Note that preload events aren't synchronized, so depending on what you use them for it can cause issues in online multiplayer games and replays.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code