Skip to content

Commit

Permalink
Merge branch 'hotpursuit' into 'master'
Browse files Browse the repository at this point in the history
Require Pursue packages to target a player

See merge request OpenMW/openmw!4239
  • Loading branch information
psi29a committed Jul 9, 2024
2 parents 3a5ed99 + 0342a29 commit 82f6845
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions files/data/scripts/omw/ai.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local self = require('openmw.self')
local interfaces = require('openmw.interfaces')
local types = require('openmw.types')
local util = require('openmw.util')

local function startPackage(args)
Expand All @@ -10,6 +11,7 @@ local function startPackage(args)
self:_startAiCombat(args.target, cancelOther)
elseif args.type == 'Pursue' then
if not args.target then error("target required") end
if not types.Player.objectIsInstance(args.target) then error("target must be a player") end
self:_startAiPursue(args.target, cancelOther)
elseif args.type == 'Follow' then
if not args.target then error("target required") end
Expand Down

0 comments on commit 82f6845

Please sign in to comment.