don't move if next pos is not in or around box

This commit is contained in:
ethan merchant 2024-11-10 05:08:05 -05:00
parent c1f0bcc956
commit 5b0a096502

View file

@ -127,14 +127,8 @@ static class Mono
return;
}
XYZi next_pos = snake[0] + snake_dir;
XYZi inset_pos = new(
next_pos.x - Maths.sign(next_pos.x),
next_pos.y - Maths.sign(next_pos.y),
next_pos.z - Maths.sign(next_pos.z)
);
bool around_box = s_array.InRange(inset_pos);
if (!around_box)
bool in_or_around_box = s_array.InRange(snake[0] + snake_dir);
if (!in_or_around_box)
{
return;
}