forked from teamnwah/openmw-tes3coop
Merge pull request #1584
This commit is contained in:
commit
e9ecaf712b
1 changed files with 11 additions and 0 deletions
|
@ -227,6 +227,17 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
else if(axis == "z")
|
else if(axis == "z")
|
||||||
{
|
{
|
||||||
|
// We should not place actors under ground
|
||||||
|
if (ptr.getClass().isActor())
|
||||||
|
{
|
||||||
|
float terrainHeight = -std::numeric_limits<float>::max();
|
||||||
|
if (ptr.getCell()->isExterior())
|
||||||
|
terrainHeight = MWBase::Environment::get().getWorld()->getTerrainHeightAt(osg::Vec3f(ax, ay, az));
|
||||||
|
|
||||||
|
if (pos < terrainHeight)
|
||||||
|
pos = terrainHeight;
|
||||||
|
}
|
||||||
|
|
||||||
updated = MWBase::Environment::get().getWorld()->moveObject(ptr,ax,ay,pos);
|
updated = MWBase::Environment::get().getWorld()->moveObject(ptr,ax,ay,pos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue