don't attack friendly actors
This commit is contained in:
parent
b6059b2bb8
commit
6a75e5a158
1 changed files with 14 additions and 0 deletions
|
@ -7,6 +7,15 @@ local this = {}
|
|||
|
||||
local function log(...) if config.debug then common.log(...) end end
|
||||
|
||||
local function isFriendlyActor(actor)
|
||||
for friend in tes3.iterate(tes3.mobilePlayer.friendlyActors) do
|
||||
if actor.object.id == friend.object.id or actor.object.baseObject.id == friend.object.baseObject.id then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function alertGuards(aggressor, cell)
|
||||
-- a wanted player gets no help
|
||||
if tes3.mobilePlayer.bounty > 0 then
|
||||
|
@ -53,6 +62,11 @@ this.onCombatStart = function(e)
|
|||
return
|
||||
end
|
||||
|
||||
if isFriendlyActor(e.actor) then
|
||||
log("Friendly actor, not helping.")
|
||||
return
|
||||
end
|
||||
|
||||
local cell = tes3.getPlayerCell()
|
||||
|
||||
if cell.isInterior and not cell.behavesAsExterior then
|
||||
|
|
Loading…
Add table
Reference in a new issue