mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
Use CellId::mWorldspace to find out whether objects are in the same worldspace
This commit is contained in:
parent
621e81fa7d
commit
d64be1c092
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
#include <components/compiler/locals.hpp>
|
#include <components/compiler/locals.hpp>
|
||||||
|
|
||||||
|
#include <components/esm/cellid.hpp>
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
@ -435,8 +437,7 @@ namespace MWScript
|
|||||||
const MWWorld::Ptr ref = MWBase::Environment::get().getWorld()->getPtr(name, false);
|
const MWWorld::Ptr ref = MWBase::Environment::get().getWorld()->getPtr(name, false);
|
||||||
|
|
||||||
// If the objects are in different worldspaces, return a large value (just like vanilla)
|
// If the objects are in different worldspaces, return a large value (just like vanilla)
|
||||||
if (ref.getCell()->isExterior() ^ ref2.getCell()->isExterior()
|
if (ref.getCell()->getCell()->getCellId().mWorldspace != ref2.getCell()->getCell()->getCellId().mWorldspace)
|
||||||
|| (!ref.getCell()->isExterior() && !ref2.getCell()->isExterior() && ref.getCell() != ref2.getCell()))
|
|
||||||
return std::numeric_limits<float>().max();
|
return std::numeric_limits<float>().max();
|
||||||
|
|
||||||
double diff[3];
|
double diff[3];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user