mirror of https://github.com/kami-blue/client
[fix] BaritoneUtils not unpausing correctly (#1758)
* Fix not unpausing even though control is lost Sometimes, we call unpause() even though the temporary process lost control. We should still change the paused variable to false if it is paused regardless. Co-authored-by: theredstoner <huddy987@yahoo.com> Co-authored-by: Xiaro <62033805+Xiaro@users.noreply.github.com>
This commit is contained in:
parent
43ad247470
commit
0a571361a9
|
@ -15,26 +15,17 @@ object BaritoneUtils {
|
|||
val isPathing get() = primary?.pathingBehavior?.isPathing ?: false
|
||||
val isActive
|
||||
get() = primary?.customGoalProcess?.isActive ?: false
|
||||
|| primary?.pathingControlManager?.mostRecentInControl()?.let {
|
||||
it.isPresent && it.get().isActive
|
||||
} ?: false
|
||||
|| primary?.pathingControlManager?.mostRecentInControl()?.orElse(null)?.isActive ?: false
|
||||
|
||||
fun pause() {
|
||||
if (!paused) {
|
||||
primary?.pathingControlManager?.registerProcess(TemporaryPauseProcess)
|
||||
paused = true
|
||||
primary?.pathingControlManager?.registerProcess(TemporaryPauseProcess)
|
||||
}
|
||||
}
|
||||
|
||||
fun unpause() {
|
||||
if (paused) {
|
||||
primary?.pathingControlManager?.mostRecentInControl()?.let {
|
||||
if (it.isPresent && it.get() == TemporaryPauseProcess) /* Don't run if not paused lol */ {
|
||||
paused = false
|
||||
it.get().onLostControl()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun cancelEverything() = primary?.pathingBehavior?.cancelEverything()
|
||||
|
|
Loading…
Reference in New Issue