Skip to content

Commit

Permalink
added missing state checks
Browse files Browse the repository at this point in the history
  • Loading branch information
CzechHek committed Sep 20, 2023
1 parent fbff32e commit 5bc67ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Expand Up @@ -2,7 +2,7 @@

package net.ccbluex.liquidbounce.features.module.modules.`fun`

import kotlinx.coroutines.*
import kotlinx.coroutines.delay
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.ModuleCategory
import net.ccbluex.liquidbounce.features.module.modules.movement.InventoryMove
Expand Down Expand Up @@ -53,6 +53,9 @@ object CoroutineArmorer: Module("CoroutineArmorer", ModuleCategory.BETA) {

private suspend fun shouldExecute(onlyHotbar: Boolean = false): Boolean {
while (true) {
if (!state)
return false

if (mc.thePlayer.openContainer?.windowId != 0 && (!hotbar || onlyWhenNoScreen))
return false

Expand Down
Expand Up @@ -6,7 +6,7 @@

package net.ccbluex.liquidbounce.features.module.modules.`fun`

import kotlinx.coroutines.*
import kotlinx.coroutines.delay
import net.ccbluex.liquidbounce.event.EventTarget
import net.ccbluex.liquidbounce.event.PacketEvent
import net.ccbluex.liquidbounce.event.Render2DEvent
Expand Down Expand Up @@ -77,6 +77,9 @@ object CoroutineStealer : Module("CoroutineStealer", ModuleCategory.BETA) {

private suspend fun shouldExecute(): Boolean {
while (true) {
if (!state)
return false

if (mc.currentScreen !is GuiChest)
return false

Expand Down

0 comments on commit 5bc67ad

Please sign in to comment.