fixed small bug

This commit is contained in:
mathusummut
2019-04-06 02:12:30 +02:00
parent 23471ac39d
commit 1bb033b5e2

View File

@@ -665,13 +665,11 @@ namespace Game {
if (!found) {
for (int i = -1; i <= 1; ++i) {
for (int j = -1; j <= 1; ++j) {
if (!(i == 0 && j == 0)) {
Vec2i pos = position + Vec2i(i, j);
found = (((targetField & fWater) == fWater) == map->getDeepSubmerged(map->getCell(pos))) && map->isFreeCell(pos, targetField, true);
if (found) {
position = pos;
break;
}
Vec2i pos = position + Vec2i(i, j);
found = (((targetField & fWater) == fWater) == map->getDeepSubmerged(map->getCell(pos))) && map->isFreeCell(pos, targetField, true);
if (found) {
position = pos;
break;
}
}
if (found)