Fixed the builds.
This commit is contained in:
parent
e41e560219
commit
c5abf71735
|
@ -217,14 +217,14 @@ monster_agressive_walk(Monster *m, RoomMatrix *rm)
|
||||||
if (!position_in_roommatrix(&next))
|
if (!position_in_roommatrix(&next))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
x_dist = next.x - rm->playerRoomPos.x;
|
x_dist = abs(next.x - rm->playerRoomPos.x);
|
||||||
y_dist = next.y - rm->playerRoomPos.y;
|
y_dist = abs(next.y - rm->playerRoomPos.y);
|
||||||
|
|
||||||
if (rm->spaces[next.x][next.y].occupied) {
|
if (rm->spaces[next.x][next.y].occupied) {
|
||||||
nextScore += 50;
|
nextScore += 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
nextScore += (max(abs(x_dist), abs(y_dist)));
|
nextScore += x_dist > y_dist ? x_dist : y_dist;
|
||||||
if (nextScore < currentScore) {
|
if (nextScore < currentScore) {
|
||||||
currentScore = nextScore;
|
currentScore = nextScore;
|
||||||
chosenDirection = (Direction)i;
|
chosenDirection = (Direction)i;
|
||||||
|
|
Loading…
Reference in New Issue