Commit 66567be2 authored by ceddral's avatar ceddral
Browse files

context: clear screen in context Register

avoid artifacts when switching contexts
parent 1fcfe6c8
......@@ -380,6 +380,7 @@ func NewGame(pns []string, extensions []string) (g *Game) {
}
func (g *Game) Register(glp *Player) {
glp.scr.Clear()
g.Lock()
p := g.players[glp.name]
p.lostConnection = false
......@@ -880,7 +881,6 @@ func (s *StateFinished) action(p *GamePlayer, key Key) bool {
delete(s.g.players, p.name)
s.g.Unlock()
p.gameKill <- struct{}{}
p.scr.Clear()
gs.Lock()
glp := gs.players[p.name]
glp.context = glgl
......
......@@ -37,6 +37,7 @@ func (gl *GameLobby) Unlock() {
}
func (gl *GameLobby) Register(glp *Player) {
glp.scr.Clear()
gl.Lock()
gl.unregisterUnlocked(glp.name)
p := &GameLobbyPlayer{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment