Skip to content

Commit

Permalink
fix detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Feb 16, 2025
1 parent 6ed9183 commit 9be6a2b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ object ModuleKillAura : ClientModule("KillAura", Category.COMBAT) {
*
* @return The best spot to attack the entity
*/
private fun getSpot(entity: LivingEntity, range: Double, situation: PointTracker.AimSituation): RotationWithVector? {
private fun getSpot(entity: LivingEntity, range: Double,
situation: PointTracker.AimSituation): RotationWithVector? {
val point = pointTracker.gatherPoint(
entity,
situation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,14 @@ object RotationManager : EventListener {
val triggerNoChange = triggerNoDifference && aimPlan.slowStart?.onZeroRotationDifference == true

if (triggerNoChange || enemyChange) {
aimPlan.slowStart?.onTrigger()
aimPlan.slowStart.onTrigger()
}
}

// Prevents any rotation changes when inventory is opened
val allowedRotation = ((!InventoryManager.isInventoryOpen &&
mc.currentScreen !is GenericContainerScreen) || !activeRotationTarget.considerInventory) && allowedToUpdate()
mc.currentScreen !is GenericContainerScreen) || !activeRotationTarget.considerInventory)
&& allowedToUpdate()

if (allowedRotation) {
val fromRotation = currentRotation ?: playerRotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ private open class BestRotationTracker(val comparator: Comparator<Rotation>, val
}
}

protected open fun getIsRotationBetter(base: RotationWithVector?, newRotation: RotationWithVector, visible: Boolean): Boolean {
open fun getIsRotationBetter(base: RotationWithVector?, newRotation: RotationWithVector,
visible: Boolean): Boolean {
return base?.let { currentlyBest ->
this.comparator.compare(currentlyBest.rotation, newRotation.rotation) > 0
} ?: true
} != false
}

}
Expand All @@ -161,7 +162,8 @@ private class PrePlaningTracker(
private val bestVisibleIntersects = false
private val bestInvisibleIntersects = false

override fun getIsRotationBetter(base: RotationWithVector?, newRotation: RotationWithVector, visible: Boolean): Boolean {
override fun getIsRotationBetter(base: RotationWithVector?, newRotation: RotationWithVector,
visible: Boolean): Boolean {
val intersects = futureTarget.isHitByLine(eyes, newRotation.vec)

val isBetterWhenVisible = visible && !bestVisibleIntersects
Expand Down

0 comments on commit 9be6a2b

Please sign in to comment.