mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-12 03:36:32 +00:00
Fix improper assignement of spawn point in placeAt for non-actors (Bug #3417)
This commit is contained in:
parent
ab2089bbf3
commit
3645b3357e
@ -1326,10 +1326,11 @@ namespace MWWorld
|
|||||||
|
|
||||||
int fallbackDirections[4] = {direction, (direction+3)%4, (direction+2)%4, (direction+1)%4};
|
int fallbackDirections[4] = {direction, (direction+3)%4, (direction+2)%4, (direction+1)%4};
|
||||||
|
|
||||||
|
osg::Vec3f spawnPoint = pos;
|
||||||
|
|
||||||
for (int i=0; i<4; ++i)
|
for (int i=0; i<4; ++i)
|
||||||
{
|
{
|
||||||
direction = fallbackDirections[i];
|
direction = fallbackDirections[i];
|
||||||
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;
|
||||||
@ -1345,12 +1346,12 @@ namespace MWWorld
|
|||||||
pos.x(), pos.y(), pos.z() + 20))
|
pos.x(), pos.y(), pos.z() + 20))
|
||||||
{
|
{
|
||||||
// safe
|
// safe
|
||||||
ipos.pos[0] = spawnPoint.x();
|
|
||||||
ipos.pos[1] = spawnPoint.y();
|
|
||||||
ipos.pos[2] = spawnPoint.z();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ipos.pos[0] = spawnPoint.x();
|
||||||
|
ipos.pos[1] = spawnPoint.y();
|
||||||
|
ipos.pos[2] = spawnPoint.z();
|
||||||
|
|
||||||
if (!referenceObject.getClass().isActor())
|
if (!referenceObject.getClass().isActor())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user