mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
Use default objects for NavigatorStub methods result
This commit is contained in:
parent
ece111d05a
commit
8d2af94b75
4 changed files with 12 additions and 7 deletions
|
@ -191,7 +191,7 @@ namespace DetourNavigator
|
|||
*/
|
||||
virtual std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const = 0;
|
||||
|
||||
virtual Settings getSettings() const = 0;
|
||||
virtual const Settings& getSettings() const = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ namespace DetourNavigator
|
|||
return mNavMeshManager.getNavMeshes();
|
||||
}
|
||||
|
||||
Settings NavigatorImpl::getSettings() const
|
||||
const Settings& NavigatorImpl::getSettings() const
|
||||
{
|
||||
return mSettings;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace DetourNavigator
|
|||
|
||||
std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const override;
|
||||
|
||||
Settings getSettings() const override;
|
||||
const Settings& getSettings() const override;
|
||||
|
||||
private:
|
||||
Settings mSettings;
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
|
||||
namespace DetourNavigator
|
||||
{
|
||||
struct NavigatorStub final : public Navigator
|
||||
class NavigatorStub final : public Navigator
|
||||
{
|
||||
public:
|
||||
NavigatorStub() = default;
|
||||
|
||||
void addAgent(const osg::Vec3f& /*agentHalfExtents*/) override {}
|
||||
|
@ -65,7 +66,7 @@ namespace DetourNavigator
|
|||
|
||||
SharedNavMeshCacheItem getNavMesh(const osg::Vec3f& /*agentHalfExtents*/) const override
|
||||
{
|
||||
return SharedNavMeshCacheItem();
|
||||
return mEmptyNavMeshCacheItem;
|
||||
}
|
||||
|
||||
std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const override
|
||||
|
@ -73,10 +74,14 @@ namespace DetourNavigator
|
|||
return std::map<osg::Vec3f, SharedNavMeshCacheItem>();
|
||||
}
|
||||
|
||||
Settings getSettings() const override
|
||||
const Settings& getSettings() const override
|
||||
{
|
||||
return Settings {};
|
||||
return mDefaultSettings;
|
||||
}
|
||||
|
||||
private:
|
||||
Settings mDefaultSettings {};
|
||||
SharedNavMeshCacheItem mEmptyNavMeshCacheItem;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue