aboutsummaryrefslogtreecommitdiff
path: root/go/client/game.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-08-03 20:49:24 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:53 +0100
commit557b6431c5b983dff51f00c6faea751df2154d08 (patch)
tree85a573954319bd0497564c366f425e4fa26df388 /go/client/game.go
parent833534b5a58bf1abfad4101dd264ff760382067f (diff)
downloadmuhqs-game-557b6431c5b983dff51f00c6faea751df2154d08.tar.gz
muhqs-game-557b6431c5b983dff51f00c6faea751df2154d08.zip
remove duplicate selectedObject assignments
The selected obj is assigned when creating an action choice therefore it is not necessary to assign it additionally beforehand.
Diffstat (limited to 'go/client/game.go')
-rw-r--r--go/client/game.go2
1 files changed, 0 insertions, 2 deletions
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)
}
}