It was hilarious to suddenly see a horde of them rush in, but I’m veeery certain this isn’t supposed to happen:

Edit: I found out something in my code causes it to happen:
loop
local enemies = self:findEnemies()
for en=1, #enemies do
local enemy = enemies[en];
if enemy.type ~= "sand-yak" and enemy.type ~= "raven" and enemy.health > 0 then
local distance = self:distanceTo(enemy)
end
end
self:move({x=self.pos.x+math.random(0,2)-1,y=self.pos.y+math.random(0,2)-1})
end
Edit 2:
to be exact, this is what triggers it:
self:move({x=self.pos.x+math.random(0,2)-1,y=self.pos.y+math.random(0,2)-1})
self:move({x=self.pos.x+math.random(0,2)-1,y=self.pos.y+math.random(0,2)-1})
as soon as it’s called a second time, the sand-yak’s rush in. XD
Edit 3:
JavaScript has the same thing, however needs it to be called more than 2 times, but triggers nonetheless.
function rand(min, max) {
return Math.random() * (max - min) + min;
}
loop {
this.move({x: this.pos.x+rand(0,2)-1 , y: this.pos.y+rand(0,2)-1 });
}
I couldn’t get a random function working in python, haven’t used it as much yet. But I assume if it’s in 2 languages, it’s all of them.