mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 17:45:34 +00:00
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/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/mechanicsmanager.hpp"
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
|
|
||||||
|
#include "../mwworld/class.hpp"
|
||||||
|
|
||||||
#include "player.hpp"
|
#include "player.hpp"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
@ -40,6 +43,11 @@ namespace MWWorld
|
||||||
for(std::set<MWWorld::Ptr>::iterator it = followers.begin();it != followers.end();++it)
|
for(std::set<MWWorld::Ptr>::iterator it = followers.begin();it != followers.end();++it)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr follower = *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()
|
if ((follower.getRefData().getPosition().asVec3() - actor.getRefData().getPosition().asVec3()).length2()
|
||||||
<= 800*800)
|
<= 800*800)
|
||||||
teleport(*it);
|
teleport(*it);
|
||||||
|
|
Loading…
Reference in a new issue