Skip to content

Commit

Permalink
fix(legacy): KillAura not working when Fucker is enabled and player i…
Browse files Browse the repository at this point in the history
…s close to own bed (#5553)
  • Loading branch information
RtxOP authored Feb 7, 2025
1 parent e1cbb19 commit ddf1ec3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R) {
private fun shouldPrioritize(): Boolean = when {
!onScaffold && (Scaffold.handleEvents() && (Scaffold.placeRotation != null || currentRotation != null) || Tower.handleEvents() && Tower.isTowering) -> true

!onDestroyBlock && (Fucker.handleEvents() && !Fucker.noHit && Fucker.pos != null || Nuker.handleEvents()) -> true
!onDestroyBlock && (Fucker.handleEvents() && !Fucker.noHit && Fucker.pos != null && !Fucker.isOwnBed || Nuker.handleEvents()) -> true

activationSlot && SilentHotbar.currentSlot != preferredSlot - 1 -> true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ object Fucker : Module("Fucker", Category.WORLD) {
private var blockHitDelay = 0
private val switchTimer = MSTimer()
var currentDamage = 0F
var isOwnBed = false

// Surroundings
private var areSurroundings = false
Expand All @@ -95,6 +96,7 @@ object Fucker : Module("Fucker", Category.WORLD) {
currentDamage = 0F
pos = null
areSurroundings = false
isOwnBed = false
}

val onPacket = handler<PacketEvent> { event ->
Expand Down Expand Up @@ -126,14 +128,16 @@ object Fucker : Module("Fucker", Category.WORLD) {
if (pos == null) {
currentDamage = 0F
areSurroundings = false
isOwnBed = false
return@handler
}

var currentPos = pos ?: return@handler
var spot = faceBlock(currentPos) ?: return@handler

// Check if it is the player's own bed
if (ignoreOwnBed && isBedNearSpawn(currentPos)) {
isOwnBed = ignoreOwnBed && isBedNearSpawn(currentPos)
if (isOwnBed) {
return@handler
}

Expand Down Expand Up @@ -212,7 +216,8 @@ object Fucker : Module("Fucker", Category.WORLD) {
// Destroy block
action == "Destroy" || areSurroundings -> {
// Check if it is the player's own bed
if (ignoreOwnBed && isBedNearSpawn(currentPos)) {
isOwnBed = ignoreOwnBed && isBedNearSpawn(currentPos)
if (isOwnBed) {
return@loopHandler
}

Expand Down Expand Up @@ -297,7 +302,8 @@ object Fucker : Module("Fucker", Category.WORLD) {
val pos = pos ?: return@handler

// Check if it is the player's own bed
if (mc.thePlayer == null || ignoreOwnBed && isBedNearSpawn(pos)) {
isOwnBed = ignoreOwnBed && isBedNearSpawn(pos)
if (mc.thePlayer == null || isOwnBed) {
return@handler
}

Expand Down

0 comments on commit ddf1ec3

Please sign in to comment.