From 18391a6c0af82a2697733b5618eb52fb87f2d56d Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 19 Oct 2023 12:42:25 +0100 Subject: [PATCH] Rewrote is_behind_Victim --- .../willfp/libreforge/filters/impl/FilterIsBehindVictim.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/kotlin/com/willfp/libreforge/filters/impl/FilterIsBehindVictim.kt b/core/src/main/kotlin/com/willfp/libreforge/filters/impl/FilterIsBehindVictim.kt index bce88c741..3c7a8ad14 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/filters/impl/FilterIsBehindVictim.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/filters/impl/FilterIsBehindVictim.kt @@ -3,6 +3,7 @@ package com.willfp.libreforge.filters.impl import com.willfp.eco.core.config.interfaces.Config import com.willfp.libreforge.NoCompileData import com.willfp.libreforge.angle +import com.willfp.libreforge.dot import com.willfp.libreforge.filters.Filter import com.willfp.libreforge.toFloat3 import com.willfp.libreforge.triggers.TriggerData @@ -21,8 +22,7 @@ object FilterIsBehindVictim : Filter("is_behind_victim") val playerVector = player.location.direction.toFloat3().xz val victimVector = victim.location.direction.toFloat3().xz - val angle = Math.toDegrees(playerVector.angle(victimVector).toDouble()).roundToInt() - val isBehind = angle in (-32..60) // Old code from Backstab from EE v8 + val isBehind = playerVector.dot(victimVector) < 0 return isBehind == value } }