summaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index c6c00768e..5bbbd154d 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -91,6 +91,9 @@ public:
}
bool getCollisionBox(aabb3f *toset) const { return false; }
+
+ virtual bool getSelectionBox(aabb3f *toset) const { return false; }
+
bool collideWithObjects() const { return false; }
private:
@@ -746,6 +749,18 @@ bool LuaEntitySAO::getCollisionBox(aabb3f *toset) const
return false;
}
+bool LuaEntitySAO::getSelectionBox(aabb3f *toset) const
+{
+ if (!m_prop.is_visible) {
+ return false;
+ }
+
+ toset->MinEdge = m_prop.collisionbox.MinEdge * BS;
+ toset->MaxEdge = m_prop.collisionbox.MaxEdge * BS;
+
+ return true;
+}
+
bool LuaEntitySAO::collideWithObjects() const
{
return m_prop.collideWithObjects;
@@ -1405,3 +1420,14 @@ bool PlayerSAO::getCollisionBox(aabb3f *toset) const
toset->MaxEdge += m_base_position;
return true;
}
+
+bool PlayerSAO::getSelectionBox(aabb3f *toset) const
+{
+ if (!m_prop.is_visible) {
+ return false;
+ }
+
+ getCollisionBox(toset);
+
+ return true;
+}