Deprecated.
| 65 | |
| 66 | // Deprecated. |
| 67 | bool LOSAndReturnTarget(GameVector* origin, GameVector* target, int push) |
| 68 | { |
| 69 | int x = origin->x; |
| 70 | int y = origin->y; |
| 71 | int z = origin->z; |
| 72 | short roomNumber = origin->RoomNumber; |
| 73 | short roomNumber2 = roomNumber; |
| 74 | int dx = (target->x - x) >> 3; |
| 75 | int dy = (target->y - y) >> 3; |
| 76 | int dz = (target->z - z) >> 3; |
| 77 | bool flag = false; |
| 78 | bool result = false; |
| 79 | |
| 80 | int i; |
| 81 | for (i = 0; i < 8; ++i) |
| 82 | { |
| 83 | roomNumber2 = roomNumber; |
| 84 | auto* floor = GetFloor(x, y, z, &roomNumber); |
| 85 | |
| 86 | if (g_Level.Rooms[roomNumber2].flags & ENV_FLAG_SWAMP) |
| 87 | { |
| 88 | flag = true; |
| 89 | break; |
| 90 | } |
| 91 | |
| 92 | int floorHeight = GetFloorHeight(floor, x, y, z); |
| 93 | int ceilingHeight = GetCeiling(floor, x, y, z); |
| 94 | if (floorHeight != NO_HEIGHT && ceilingHeight != NO_HEIGHT && ceilingHeight < floorHeight) |
| 95 | { |
| 96 | if (y > floorHeight) |
| 97 | { |
| 98 | if (y - floorHeight >= push) |
| 99 | { |
| 100 | flag = true; |
| 101 | break; |
| 102 | } |
| 103 | |
| 104 | y = floorHeight; |
| 105 | } |
| 106 | |
| 107 | if (y < ceilingHeight) |
| 108 | { |
| 109 | if (ceilingHeight - y >= push) |
| 110 | { |
| 111 | flag = true; |
| 112 | break; |
| 113 | } |
| 114 | |
| 115 | y = ceilingHeight; |
| 116 | } |
| 117 | |
| 118 | result = true; |
| 119 | } |
| 120 | else if (result) |
| 121 | { |
| 122 | flag = true; |
| 123 | break; |
| 124 | } |
no test coverage detected