Rewrite completely

Hopefully, this should be working gatherer code that doesn't waste
energy on unnecessary scans or fight over food.