mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-16 22:11:33 +00:00
PlaceAt: don't correct spawn points for non-actors
This commit is contained in:
parent
16dca126dd
commit
76b47c6d5d
1 changed files with 5 additions and 1 deletions
|
@ -1341,12 +1341,16 @@ namespace MWWorld
|
||||||
for (int i=0; i<4; ++i)
|
for (int i=0; i<4; ++i)
|
||||||
{
|
{
|
||||||
direction = fallbackDirections[i];
|
direction = fallbackDirections[i];
|
||||||
// check if spawn point is safe, fall back to another direction if not
|
|
||||||
osg::Vec3f spawnPoint = pos;
|
osg::Vec3f spawnPoint = pos;
|
||||||
if (direction == 0) spawnPoint = pos + (orientation * osg::Vec3f(0,1,0)) * distance;
|
if (direction == 0) spawnPoint = pos + (orientation * osg::Vec3f(0,1,0)) * distance;
|
||||||
else if(direction == 1) spawnPoint = pos - (orientation * osg::Vec3f(0,1,0)) * distance;
|
else if(direction == 1) spawnPoint = pos - (orientation * osg::Vec3f(0,1,0)) * distance;
|
||||||
else if(direction == 2) spawnPoint = pos - (orientation * osg::Vec3f(1,0,0)) * distance;
|
else if(direction == 2) spawnPoint = pos - (orientation * osg::Vec3f(1,0,0)) * distance;
|
||||||
else if(direction == 3) spawnPoint = pos + (orientation * osg::Vec3f(1,0,0)) * distance;
|
else if(direction == 3) spawnPoint = pos + (orientation * osg::Vec3f(1,0,0)) * distance;
|
||||||
|
|
||||||
|
if (!ptr.getClass().isActor())
|
||||||
|
break;
|
||||||
|
|
||||||
|
// check if spawn point is safe, fall back to another direction if not
|
||||||
spawnPoint.z() += 30; // move up a little to account for slopes, will snap down later
|
spawnPoint.z() += 30; // move up a little to account for slopes, will snap down later
|
||||||
|
|
||||||
if (!castRay(spawnPoint.x(), spawnPoint.y(), spawnPoint.z(),
|
if (!castRay(spawnPoint.x(), spawnPoint.y(), spawnPoint.z(),
|
||||||
|
|
Loading…
Reference in a new issue