aboutsummaryrefslogtreecommitdiff
path: root/src/common/Collision/Models
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Collision/Models')
-rw-r--r--src/common/Collision/Models/GameObjectModel.cpp7
-rw-r--r--src/common/Collision/Models/GameObjectModel.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/src/common/Collision/Models/GameObjectModel.cpp b/src/common/Collision/Models/GameObjectModel.cpp
index 7e8d0b9d438..5d8712561f6 100644
--- a/src/common/Collision/Models/GameObjectModel.cpp
+++ b/src/common/Collision/Models/GameObjectModel.cpp
@@ -140,14 +140,11 @@ bool GameObjectModel::initialize(std::unique_ptr<GameObjectModelOwnerBase> model
return true;
}
-GameObjectModel* GameObjectModel::Create(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string const& dataPath)
+std::unique_ptr<GameObjectModel> GameObjectModel::Create(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string const& dataPath)
{
- GameObjectModel* mdl = new GameObjectModel();
+ std::unique_ptr<GameObjectModel> mdl(new GameObjectModel());
if (!mdl->initialize(std::move(modelOwner), dataPath))
- {
- delete mdl;
return nullptr;
- }
return mdl;
}
diff --git a/src/common/Collision/Models/GameObjectModel.h b/src/common/Collision/Models/GameObjectModel.h
index c55ac34e482..2ea99f61e20 100644
--- a/src/common/Collision/Models/GameObjectModel.h
+++ b/src/common/Collision/Models/GameObjectModel.h
@@ -79,7 +79,7 @@ public:
bool GetLocationInfo(G3D::Vector3 const& point, VMAP::LocationInfo& info, PhaseShift const& phaseShift) const;
bool GetLiquidLevel(G3D::Vector3 const& point, VMAP::LocationInfo& info, float& liqHeight) const;
- static GameObjectModel* Create(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string const& dataPath);
+ static std::unique_ptr<GameObjectModel> Create(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string const& dataPath);
bool UpdatePosition();