Skip to content

Run history fix - #834

Merged
tmewett merged 3 commits into
tmewett:masterfrom
HangryHippo:RunHistoryFix
Jun 28, 2026
Merged

tmewett merged 3 commits into
tmewett:masterfrom
HangryHippo:RunHistoryFix

Conversation

@HangryHippo

Copy link
Copy Markdown
Contributor

This should fix issue #833.

Previously, not-playback, not-easy, not-normal mode was saved, i.e. wizard mode.

It should now be not-playback, not-easy, not-wizard mode, i.e. normal mode that gets saved in BrogueRunHistory.txt.

Changed GAME_MODE_NORMAL to GAME_MODE_WIZARD so that normal mode gets saved in the run history file.
Comment thread src/brogue/RogueMain.c Outdated
}

if (!rogue.playbackMode && rogue.mode != GAME_MODE_EASY && rogue.mode != GAME_MODE_NORMAL) {
if (!rogue.playbackMode && rogue.mode != GAME_MODE_EASY && rogue.mode != GAME_MODE_WIZARD) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Would it work to instead change the last 2 parts of this condition to rogue.mode == GAME_MODE_NORMAL? That would make this code a bit simpler.

@HangryHippo

HangryHippo commented Mar 22, 2026 •

Copy link
Copy Markdown
Contributor Author

It should work. Honestly, I don't know why that line of code doesn't just check directly for normal mode. I think we should also change line #1210 in the same file, for the cases of quitting/dying being saved in the run history:

if (!rogue.playbackMode && rogue.mode != GAME_MODE_EASY &&  rogue.mode != GAME_MODE_WIZARD) {
        saveRunHistory(rogue.quit ? "Quit" : "Died", rogue.quit ? "-" : killedBy, (int) theEntry.score, numGems);
    }

Unless there's a good reason why it should stay as before?

@nstoddard

Copy link
Copy Markdown
Collaborator

It looks like before #760, the two checks couldn't be merged since they checked two different variables (it checked !rogue.easyMode && !rogue.wizard). I don't see any reason not to simplify this now that it's possible.

Saving run history now checks for normal mode directly.
@HangryHippo

Copy link
Copy Markdown
Contributor Author

Ok, done! Both lines have been simplified, in addition to the fix.

@nstoddard

Copy link
Copy Markdown
Collaborator

Should this be on the release branch instead of master, since it shouldn't break recordings?

@HangryHippo

Copy link
Copy Markdown
Contributor Author

Probably. I'll pay attention to branches (release/master) next time. Should I just close this and open a new pull request targeting the release branch? Or should I wait to see what Tmewett wants to do? I believe he is able to unilaterally merge into 'release' on his own.

@nstoddard

Copy link
Copy Markdown
Collaborator

It's possible to change an existing PR to target a different branch by clicking the edit button next to the title; unfortunately that only works well if both branches have the same newest commit, which isn't the case at the moment. It doesn't seem possible to change the source branch in the same way, so doing this would require modifying your branch to build on top of release instead of master, which would likely require some ugly git commands. I think it's fine to wait to see what tmewett recommends here; he might know an easier way.

@tmewett
tmewett changed the base branch from master to release June 28, 2026 21:36
@tmewett
tmewett changed the base branch from release to master June 28, 2026 21:44
@tmewett
tmewett merged commit 7f52dd9 into tmewett:master Jun 28, 2026
@tmewett

tmewett commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Yeah, sadly I can't do that much branch reshuffling via the web UI. Thanks for the PR, I've just applied it to 'master' and I can cherry-pick it to 'release' if needed :)

@HangryHippo
HangryHippo deleted the RunHistoryFix branch October 21, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run history incorrectly saves wizard mode victories instead of normal mode victories

3 participants