Skip to content

Commit

Permalink
Monsters shouldn't see floors above 8 (otland#3250)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro authored Jan 16, 2021
1 parent 458baa8 commit b52a2f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ bool Creature::canSee(const Position& myPos, const Position& pos, int32_t viewRa
}
} else if (myPos.z >= 8) {
//we are underground (8 -> 15)
// we can't see floors above 8
if (pos.z < 8) {
return false;
}

//view is +/- 2 from the floor we stand on
if (Position::getDistanceZ(myPos, pos) > 2) {
return false;
Expand Down

0 comments on commit b52a2f7

Please sign in to comment.