Skip to content

Commit

Permalink
Fix a crash when changing running game screen. (#42)
Browse files Browse the repository at this point in the history
If you call the SetScreen method after the game has already started it
will crash while trying to draw the new screen, because it wasn't
resized yet.
  • Loading branch information
gmoshkin authored and JoelOtter committed Aug 18, 2017
1 parent 4456ab1 commit bf4ace9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions game.go
Expand Up @@ -33,6 +33,7 @@ func (g *Game) Screen() *Screen {
// SetScreen sets the current Screen of a Game.
func (g *Game) SetScreen(s *Screen) {
g.screen = s
g.screen.resize(termbox.Size())
}

// DebugOn returns a bool showing whether or not debug mode is on.
Expand Down

0 comments on commit bf4ace9

Please sign in to comment.