diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-05 15:36:11 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-05 15:36:11 +0200 |
commit | cf39ee9e242bccecaff8444628518a566d250ae9 (patch) | |
tree | 96124c4c64c8cabb9babc8f35b35f38da8cb14c6 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | b67dc7ffe67f2da961c88c9516b12ea998fb9570 (diff) | |
download | skyhanni-cf39ee9e242bccecaff8444628518a566d250ae9.tar.gz skyhanni-cf39ee9e242bccecaff8444628518a566d250ae9.tar.bz2 skyhanni-cf39ee9e242bccecaff8444628518a566d250ae9.zip |
fixed error in the moving location calculation
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt index 081641c9a..045abbf58 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.test.command.CopyErrorCommand import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer import at.hannibal2.skyhanni.utils.LorenzUtils.toSingletonListOrEmpty @@ -103,11 +104,11 @@ class ParkourHelper( for ((index, location) in locations.asSequence().withIndex().drop(current) .take(lookAhead) + inProgressVec.map { it.second }) { - var aabb = axisAlignedBB(location) - val isMovingPlattform = location !in locations - if (isMovingPlattform) { - aabb = aabb.expandBlock() - } + val isMovingPlatform = location !in locations + if (isMovingPlatform && showEverything) continue + val aabb = if (isMovingPlatform) { + axisAlignedBB(location).expandBlock() + } else axisAlignedBB(location) event.drawFilledBoundingBox(aabb, colorForIndex(index), 1f) if (!isMovingPlattform) { @@ -123,8 +124,8 @@ class ParkourHelper( private fun getInProgressPair(): Pair<IndexedValue<LorenzVec>, IndexedValue<LorenzVec>>? { if (current < 0 || current + lookAhead >= locations.size) return null - val currentPosition = locations[current] - val nextPosition = locations[current + 1] + val currentPosition = locations[current].offsetCenter() + val nextPosition = locations[current + 1].offsetCenter() val lookAheadStart = locations[current + lookAhead - 1] val lookAheadEnd = locations[current + lookAhead] |