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 isPathing get() = primary?.pathingBehavior?.isPathing ?: false
|
||||||
val isActive
|
val isActive
|
||||||
get() = primary?.customGoalProcess?.isActive ?: false
|
get() = primary?.customGoalProcess?.isActive ?: false
|
||||||
|| primary?.pathingControlManager?.mostRecentInControl()?.let {
|
|| primary?.pathingControlManager?.mostRecentInControl()?.orElse(null)?.isActive ?: false
|
||||||
it.isPresent && it.get().isActive
|
|
||||||
} ?: false
|
|
||||||
|
|
||||||
fun pause() {
|
fun pause() {
|
||||||
if (!paused) {
|
if (!paused) {
|
||||||
primary?.pathingControlManager?.registerProcess(TemporaryPauseProcess)
|
|
||||||
paused = true
|
paused = true
|
||||||
|
primary?.pathingControlManager?.registerProcess(TemporaryPauseProcess)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun unpause() {
|
fun unpause() {
|
||||||
if (paused) {
|
paused = false
|
||||||
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()
|
fun cancelEverything() = primary?.pathingBehavior?.cancelEverything()
|
||||||
|
|
Loading…
Reference in New Issue