aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/game/ai.go4
-rw-r--r--go/game/attack.go2
-rw-r--r--go/game/map.go2
-rw-r--r--go/game/trigger.go5
4 files changed, 5 insertions, 8 deletions
diff --git a/go/game/ai.go b/go/game/ai.go
index 415f01e0..c55218e3 100644
--- a/go/game/ai.go
+++ b/go/game/ai.go
@@ -291,7 +291,7 @@ func moveAwayFromEnemies(ai *UnitAI) Action {
}
a := NewMoveAction(ai.u)
- a.Target().AddSelection(farest)
+ _ = a.Target().AddSelection(farest)
return a
}
@@ -316,7 +316,7 @@ func actionFromPaths(ai *UnitAI, graph *dijkstra.Graph, paths []*dijkstra.BestPa
for _, id := range paths[nearest].Path[1:] {
mapping, _ := graph.GetMapped(id)
var x, y int
- fmt.Sscanf(mapping, "(%d, %d)", &x, &y)
+ _, _ = fmt.Sscanf(mapping, "(%d, %d)", &x, &y)
nextStep := m.TileAt(Position{X: x, Y: y})
if slices.Contains(ai.u.MoveRangeTiles(m), nextStep) {
target = nextStep
diff --git a/go/game/attack.go b/go/game/attack.go
index 08bc9567..3896e142 100644
--- a/go/game/attack.go
+++ b/go/game/attack.go
@@ -12,7 +12,7 @@ type Attack struct {
}
func INVALID_ATTACK(a Attack) bool {
- return a.attacks == nil || len(a.attacks) == 0
+ return len(a.attacks) == 0
}
func (a Attack) MaxRange() int {
diff --git a/go/game/map.go b/go/game/map.go
index e0c99911..fb67ebbb 100644
--- a/go/game/map.go
+++ b/go/game/map.go
@@ -226,7 +226,7 @@ func (m *Map) RandomTileFromSymbols(r *rand.Rand, symbols []string) (Position, e
for _, symbol := range symbols {
tileString, ok := m.symbols[symbol]
if !ok {
- return INVALID_POSITION(), fmt.Errorf(fmt.Sprintf("symbol %s not in the map symbols %v", symbol, m.symbols))
+ return INVALID_POSITION(), fmt.Errorf("%s", fmt.Sprintf("symbol %s not in the map symbols %v", symbol, m.symbols))
}
tileType, ok := TileNames[tileString]
diff --git a/go/game/trigger.go b/go/game/trigger.go
index eb0cc424..2619bdd8 100644
--- a/go/game/trigger.go
+++ b/go/game/trigger.go
@@ -75,9 +75,7 @@ func newEotEvent() Event {
func newTargetEvent(source interface{}, targets *Targets) Event {
affected := make([]interface{}, 0, len(targets.ts))
for _, t := range targets.ts {
- for _, sel := range t.sel {
- affected = append(affected, sel)
- }
+ affected = append(affected, t.sel...)
}
return Event{eventType: target, sources: []interface{}{source}, affected: affected}
}
@@ -109,7 +107,6 @@ func (t *triggerBase) Card() *Card {
log.Panicf("Unhandled source type %v", t)
return nil
}
- return nil
}
func (t *triggerBase) trigger(s *LocalState, e Event) ([]*TriggeredAction, bool) {