somehow I forgot about sourceMod

This commit is contained in:
Lilian Jónsdóttir 2020-10-17 18:08:55 -07:00
parent 499e69e631
commit d937818ec6

View file

@ -34,7 +34,7 @@ local function doChecks(attacker, target)
-- first try baseObject, else try object.baseObject, else settle on object -- first try baseObject, else try object.baseObject, else settle on object
local obj = attacker.baseObject and attacker.baseObject or local obj = attacker.baseObject and attacker.baseObject or
(attacker.object.baseObject and attacker.object.baseObject or attacker.object) (attacker.object.baseObject and attacker.object.baseObject or attacker.object)
if config.ignored[string.lower(obj.id)] then if config.ignored[string.lower(obj.id)] or config.ignored[string.lower(obj.sourceMod)] then
log("Ignored NPC or creature detected, not helping.") log("Ignored NPC or creature detected, not helping.")
return false return false
end end
@ -105,7 +105,7 @@ this.onCombatStart = function(e)
local attacker = e.actor.object.baseObject and e.actor.object.baseObject or local attacker = e.actor.object.baseObject and e.actor.object.baseObject or
(e.actor.baseObject and e.actor.baseObject or e.actor.object) (e.actor.baseObject and e.actor.baseObject or e.actor.object)
if config.ignored[string.lower(target.id)] and attacker.isGuard then if (config.ignored[string.lower(target.id)] or config.ignored[string.lower(target.sourceMod)]) and attacker.isGuard then
log("Combat started against %s by a guard, %s... stopping...", e.target.object.name, e.actor.object.name) log("Combat started against %s by a guard, %s... stopping...", e.target.object.name, e.actor.object.name)
return false return false
end end