forked from teamnwah/openmw-tes3coop
Implement stayOutside script variable
This commit is contained in:
parent
27617468c8
commit
2d302aef99
1 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,9 @@
|
|||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/mechanicsmanager.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
#include "player.hpp"
|
||||
|
||||
namespace
|
||||
|
@ -40,6 +43,11 @@ namespace MWWorld
|
|||
for(std::set<MWWorld::Ptr>::iterator it = followers.begin();it != followers.end();++it)
|
||||
{
|
||||
MWWorld::Ptr follower = *it;
|
||||
|
||||
std::string script = follower.getClass().getScript(follower);
|
||||
if (!script.empty() && follower.getRefData().getLocals().getIntVar(script, "stayoutside") == 1)
|
||||
continue;
|
||||
|
||||
if ((follower.getRefData().getPosition().asVec3() - actor.getRefData().getPosition().asVec3()).length2()
|
||||
<= 800*800)
|
||||
teleport(*it);
|
||||
|
|
Loading…
Reference in a new issue