Refactor stinky detection to heimdall
This commit is contained in:
@@ -589,6 +589,11 @@ local function init()
|
|||||||
end
|
end
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
---@param name string
|
||||||
|
---@return boolean
|
||||||
|
shared.IsStinky = function(name)
|
||||||
|
return Heimdall_Data.config.stinkies[name] ~= nil or shared.StinkyCache[name] ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
shared.Messenger.Init()
|
shared.Messenger.Init()
|
||||||
shared.StinkyTracker.Init()
|
shared.StinkyTracker.Init()
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function shared.Sniffer.Init()
|
|||||||
end
|
end
|
||||||
if not Heimdall_Data.config.sniffer.enabled then return end
|
if not Heimdall_Data.config.sniffer.enabled then return end
|
||||||
if Heimdall_Data.config.sniffer.stinky and
|
if Heimdall_Data.config.sniffer.stinky and
|
||||||
not Heimdall_Data.config.stinkies[stinky] then
|
not shared.IsStinky(stinky) then
|
||||||
if Heimdall_Data.config.sniffer.debug then
|
if Heimdall_Data.config.sniffer.debug then
|
||||||
print(string.format("%s: Stinky not found in config", ModuleName))
|
print(string.format("%s: Stinky not found in config", ModuleName))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function shared.Spotter.Init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if Heimdall_Data.config.spotter.stinky then
|
if Heimdall_Data.config.spotter.stinky then
|
||||||
if Heimdall_Data.config.stinkies[name] then
|
if shared.IsStinky(name) then
|
||||||
if Heimdall_Data.config.spotter.debug then
|
if Heimdall_Data.config.spotter.debug then
|
||||||
print(string.format("[%s] Notifying - Found stinky: %s", ModuleName, name))
|
print(string.format("[%s] Notifying - Found stinky: %s", ModuleName, name))
|
||||||
end
|
end
|
||||||
@@ -153,7 +153,7 @@ function shared.Spotter.Init()
|
|||||||
print(string.format("[%s] Player %s coordinates: %.2f, %.2f", ModuleName, name, x * 100, y * 100))
|
print(string.format("[%s] Player %s coordinates: %.2f, %.2f", ModuleName, name, x * 100, y * 100))
|
||||||
end
|
end
|
||||||
|
|
||||||
local stinky = Heimdall_Data.config.stinkies[name] or false
|
local stinky = shared.IsStinky(name) or false
|
||||||
SetMapToCurrentZone()
|
SetMapToCurrentZone()
|
||||||
SetMapByID(GetCurrentMapAreaID())
|
SetMapByID(GetCurrentMapAreaID())
|
||||||
local text = string.format(shared.L.en.spotterSpotted,
|
local text = string.format(shared.L.en.spotterSpotted,
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ function shared.Whoer.Init()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local stinky = Heimdall_Data.config.stinkies[name]
|
local stinky = shared.IsStinky(name)
|
||||||
if stinky then
|
if stinky then
|
||||||
if Heimdall_Data.config.who.debug then
|
if Heimdall_Data.config.who.debug then
|
||||||
print(string.format("[%s] Player %s marked as stinky!", ModuleName, name))
|
print(string.format("[%s] Player %s marked as stinky!", ModuleName, name))
|
||||||
|
|||||||
Reference in New Issue
Block a user