1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

Performance fix + SAO factorization

Original credits goes to @Rogier-5

* Merge common attributes between LuaEntitySAO & PlayerSAO to UnitSAO
* Make some functions const
* Improve some lists performance by returning const ref

Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
This commit is contained in:
Rogier
2017-01-10 04:39:45 +09:00
committed by Ner'zhul
parent ec30d49e02
commit 6647939403
8 changed files with 88 additions and 117 deletions

View File

@@ -159,7 +159,7 @@ public:
void processMessage(const std::string &data);
bool getCollisionBox(aabb3f *toset) { return false; }
bool getCollisionBox(aabb3f *toset) const { return false; }
private:
scene::IMeshSceneNode *m_node;
v3f m_position;
@@ -316,7 +316,7 @@ public:
std::string infoText()
{return m_infotext;}
bool getCollisionBox(aabb3f *toset) { return false; }
bool getCollisionBox(aabb3f *toset) const { return false; }
private:
aabb3f m_selection_box;
scene::IMeshSceneNode *m_node;
@@ -587,7 +587,7 @@ GenericCAO::GenericCAO(Client *client, ClientEnvironment *env):
}
}
bool GenericCAO::getCollisionBox(aabb3f *toset)
bool GenericCAO::getCollisionBox(aabb3f *toset) const
{
if (m_prop.physical)
{