Characters: reset a difficulty

"Zuruecksetzen" in the load window lists the selected character's worlds
and asks for confirmation. The world goes (a copy in characters\deleted),
with an autosave of it, and the shared hero's story completion of that
difficulty is cleared. The dialog is one generic list (title + entries).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-20 22:04:41 +02:00
1 parent e0d8d0ce7e
commit feebe72ab7
5 files changed
+153 -41

No files matched your search

+10
View File
@@ -123,6 +123,16 @@ bool SetHeroName(Bytes& file, const std::wstring& name) {
return true;
}
bool SetStoryCompleted(Bytes& file, int difficulty, uint8_t count) {
const std::optional<Chunk> hero = FindChunk(file, kChunkHero);
if (!hero || difficulty < 0 || difficulty >= kDifficultyCount ||
hero->size < kHeroStoryCompleted + kDifficultyCount) {
return false;
}
file[hero->offset + kHeroStoryCompleted + difficulty] = count;
return true;
}
uint32_t CampaignSaveMode(int campaign) {
return campaign == kCampaignUnderworld ? kSaveModeUnderworld : kSaveModeAncaria;
}