File tree Expand file tree Collapse file tree 2 files changed +3
-22
lines changed
Expand file tree Collapse file tree 2 files changed +3
-22
lines changed Original file line number Diff line number Diff line change 1818#include " ../mwbase/mechanicsmanager.hpp"
1919#include " ../mwbase/world.hpp"
2020
21- #include " ../mwlua/localscripts.hpp"
22-
2321#include " actorutil.hpp"
2422#include " aicombataction.hpp"
2523#include " character.hpp"
@@ -121,17 +119,9 @@ namespace MWMechanics
121119
122120 // Stop if the target doesn't exist
123121 if (target.isEmpty () || !target.getCellRef ().getCount () || !target.getRefData ().isEnabled ()
124- || target.getClass ().getCreatureStats (target).isDead ())
122+ || target.getClass ().getCreatureStats (target).isDead () || !target. getRefData (). getBaseNode () )
125123 return true ;
126124
127- // This is equivalent to checking if the actor is registered with the mechanics manager since every actor has a
128- // script
129- if (const MWLua::LocalScripts* scripts = target.getRefData ().getLuaScripts ())
130- {
131- if (!scripts->isActive ())
132- return true ;
133- }
134-
135125 if (actor == target) // This should never happen.
136126 return true ;
137127
Original file line number Diff line number Diff line change 77#include " ../mwbase/windowmanager.hpp"
88#include " ../mwbase/world.hpp"
99
10- #include " ../mwlua/localscripts.hpp"
11-
1210#include " ../mwworld/class.hpp"
1311
1412#include " actorutil.hpp"
@@ -38,17 +36,10 @@ namespace MWMechanics
3836 const MWWorld::Ptr target = getTarget (); // The target to follow
3937
4038 // Stop if the target doesn't exist
41- if (target.isEmpty () || !target.getCellRef ().getCount () || !target.getRefData ().isEnabled ())
39+ if (target.isEmpty () || !target.getCellRef ().getCount () || !target.getRefData ().isEnabled ()
40+ || !target.getRefData ().getBaseNode ())
4241 return true ;
4342
44- // This is equivalent to checking if the actor is registered with the mechanics manager since every actor has a
45- // script
46- if (const MWLua::LocalScripts* scripts = target.getRefData ().getLuaScripts ())
47- {
48- if (!scripts->isActive ())
49- return true ;
50- }
51-
5243 if (isTargetMagicallyHidden (target)
5344 && !MWBase::Environment::get ().getMechanicsManager ()->awarenessCheck (target, actor, false ))
5445 return false ;
You can’t perform that action at this time.
0 commit comments