From 3d36d1d0254b8aeecc889a2a49cbcced458cbe9c Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 25 Feb 2023 23:08:47 +0100 Subject: intermediate commit * Implement move artifact action * Fix widget update memory leak * update the highlights not during on each frame * do not update the unchanged label of a button * Allow to exit the game by pressing 'q' * Implement some cards from the magic set * Improve permanent formatting * Some tweaks to UnitAI code --- go/game/range.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'go/game/range.go') diff --git a/go/game/range.go b/go/game/range.go index 07a6e234..bc50c99b 100644 --- a/go/game/range.go +++ b/go/game/range.go @@ -64,9 +64,9 @@ func PositionsInRange(origin Position, r int, includeOrigin bool) []Position { return positions } -func TilesInRangeFromOrigin(m *Map, origin Position, r int) []*Tile { +func tilesInRangeFromOrigin(m *Map, origin Position, r int, includeOrigin bool) []*Tile { tiles := []*Tile{} - for _, pos := range PositionsInRange(origin, r, false) { + for _, pos := range PositionsInRange(origin, r, includeOrigin) { tile := m.TileAt(pos) if tile != nil { tiles = append(tiles, tile) @@ -75,6 +75,10 @@ func TilesInRangeFromOrigin(m *Map, origin Position, r int) []*Tile { return tiles } +func TilesInRangeFromOrigin(m *Map, origin Position, r int) []*Tile { + return tilesInRangeFromOrigin(m, origin, r, false) +} + func TilesInRange(m *Map, p Permanent, r int) []*Tile { return TilesInRangeFromOrigin(m, TileOrContainingPermTile(p).Position, r) } -- cgit v1.2.3