fix(bots): fix gatherer Go compile error - declare nearestEnergy in function scope
The nearestEnergy variable was referenced inside findNearestEnergy() but only declared in the caller's scope. Declare it locally and use _ in caller. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8bcfdf57b3
commit
6899b2efa0
1 changed files with 2 additions and 2 deletions
|
|
@ -84,7 +84,7 @@ func (s *GathererStrategy) computeBotMove(
|
|||
}
|
||||
|
||||
// Try to find nearest untargeted energy
|
||||
nearestEnergy, path := s.findNearestEnergy(bot.Position, energyPositions, usedEnergy, enemyPositions, config)
|
||||
_, path := s.findNearestEnergy(bot.Position, energyPositions, usedEnergy, enemyPositions, config)
|
||||
if path != nil && len(path) > 0 {
|
||||
// Move towards the energy
|
||||
return &Move{
|
||||
|
|
@ -156,7 +156,7 @@ func (s *GathererStrategy) findNearestEnergy(
|
|||
queue := list.New()
|
||||
queue.PushBack(queueItem{pos: start, path: []Direction{}})
|
||||
|
||||
_ = nearestEnergy // Track found position (unused but semantically meaningful)
|
||||
var nearestEnergy Position
|
||||
var bestPath []Direction
|
||||
|
||||
for queue.Len() > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue