From 76b47c6d5dda103084d2e5c24f0470932e07f87a Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 4 Mar 2016 12:25:22 +0100 Subject: [PATCH] PlaceAt: don't correct spawn points for non-actors --- apps/openmw/mwworld/worldimp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 9f77dfed1..948612623 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1341,12 +1341,16 @@ namespace MWWorld for (int i=0; i<4; ++i) { direction = fallbackDirections[i]; - // check if spawn point is safe, fall back to another direction if not osg::Vec3f spawnPoint = pos; 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 == 2) 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 if (!castRay(spawnPoint.x(), spawnPoint.y(), spawnPoint.z(),