Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

old replays can cause wesnoth to assert #4180

Open
soliton- opened this issue Jul 18, 2019 · 2 comments

Comments

@soliton-
Copy link
Member

commented Jul 18, 2019

An old/corrupt replay can cause wesnoth to assert in this code:

team& play_controller::current_team()
{
assert(gamestate().board_.has_team(current_side()));
return gamestate().board_.get_team(current_side());
}
const team& play_controller::current_team() const
{
assert(gamestate().board_.has_team(current_side()));
return gamestate().board_.get_team(current_side());
}

It would be nicer to be able to show an error message and return to the main menu or so.

I think switching to throwing an exception may already do most of that and it seems to fit better for something that apparently may actually "normally" occur.

Unfortunately I don't have a replay at hand to test this but maybe @jostephd can provide a link?

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

Related issue: #2818

@jostephd

This comment has been minimized.

Copy link
Member

commented Jul 18, 2019

Unfortunately I don't have a replay at hand to test this but maybe @jostephd can provide a link?

Looks like pretty much any replay will do this, here's one. Just load it and skip past the OOS errors and it asserts.

Wesnoth_Tutorial_Part_I_replay.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.