From 1e6bffa4ab5d6ebc99ba06db8fa17464a8ed55e6 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 3 Aug 2023 20:49:24 +0200 Subject: remove duplicate selectedObject assignments The selected obj is assigned when creating an action choice therefore it is not necessary to assign it additionally beforehand. --- go/client/game.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'go') diff --git a/go/client/game.go b/go/client/game.go index 9f440ceb..9c95deb2 100644 --- a/go/client/game.go +++ b/go/client/game.go @@ -210,7 +210,6 @@ func (g *Game) addPermActionChoice(perm game.Permanent, x, y int) { } if len(perms) > 1 { - g.selectedObject = perms onClick := func(c *ui.Choice, x, y int) { g.removeChoice() p := perms[c.GetChoosen(x, y)] @@ -218,7 +217,6 @@ func (g *Game) addPermActionChoice(perm game.Permanent, x, y int) { } g.addChoice(ui.NewChoice(x, y, utils.TypedSliceToInterfaceSlice(labels), onClick)) } else { - g.selectedObject = perms[0] g.addActionChoice(perms[0], x, y) } } -- cgit v1.2.3