From 373ca377a21bdc172a175793c29741a15f8b22da Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Mon, 13 Jan 2025 14:09:57 +0100 Subject: [PATCH] Ignore bonk events for source==destination (self harm) --- Heimdall.toc | 2 +- Heimdall.zip | 4 ++-- Modules/BonkDetector.lua | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Heimdall.toc b/Heimdall.toc index 9bf8cf7..8c5af0f 100644 --- a/Heimdall.toc +++ b/Heimdall.toc @@ -1,6 +1,6 @@ ## Interface: 70300 ## Title: Heimdall -## Version: 3.4.1 +## Version: 3.4.2 ## Notes: Watches over areas and alerts when hostiles spotted ## Author: Cyka ## SavedVariables: Heimdall_Data diff --git a/Heimdall.zip b/Heimdall.zip index d38bc0d..33e7d53 100644 --- a/Heimdall.zip +++ b/Heimdall.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:15c42c1ca300fa9233b953a6d69330d6d168ac1067fc7d4660079fbf43b3efc8 -size 985983 +oid sha256:c3a47b2607565a5bbe2f430f2b5746ea7e98cc758293b384d2a56070f96d65b4 +size 986014 diff --git a/Modules/BonkDetector.lua b/Modules/BonkDetector.lua index e0dfa1f..445be0d 100644 --- a/Modules/BonkDetector.lua +++ b/Modules/BonkDetector.lua @@ -60,6 +60,13 @@ function shared.BonkDetector.Init() return end + if source == destination then + if Heimdall_Data.config.bonkDetector.debug then + print(string.format("[%s] Source and destination are the same, ignoring event", ModuleName)) + end + return + end + local currentTime = GetTime() local throttle = Heimdall_Data.config.bonkDetector.throttle