Untitled
unknown
diff
2 years ago
1.1 kB
10
Indexable
diff --git a/src/map.cpp b/src/map.cpp
index 16952c4..44091e9 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -574,20 +574,8 @@ bool Map::isSightClear(const Position& fromPos, const Position& toPos, bool same
return true;
}
- //sight is clear or sameFloor is enabled
- bool sightClear = checkSightLine(fromPos.x, fromPos.y, toPos.x, toPos.y, fromPos.z);
- if (sightClear || sameFloor) {
- return sightClear;
- }
-
- //no obstacles above floor 0 so we can throw above the obstacle
- if (fromPos.z == 0) {
- return true;
- }
-
- //check if tiles above us and the target are clear and check for a clear sight between them
- uint8_t newZ = fromPos.z - 1;
- return isTileClear(fromPos.x, fromPos.y, newZ, true) && isTileClear(toPos.x, toPos.y, newZ, true) && checkSightLine(fromPos.x, fromPos.y, toPos.x, toPos.y, newZ);
+ //lets check for sight clear
+ return checkSightLine(fromPos.x, fromPos.y, toPos.x, toPos.y, fromPos.z) || checkSightLine(toPos.x, toPos.y, fromPos.x, fromPos.y, fromPos.z);
}
//target is on a different floorEditor is loading...
Leave a Comment