1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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

@ -64,7 +64,7 @@ public:
m_id(id)
{
}
u16 getId()
{
return m_id;
@ -76,8 +76,8 @@ public:
}
virtual ActiveObjectType getType() const = 0;
virtual bool getCollisionBox(aabb3f *toset) = 0;
virtual bool collideWithObjects() = 0;
virtual bool getCollisionBox(aabb3f *toset) const = 0;
virtual bool collideWithObjects() const = 0;
protected:
u16 m_id; // 0 is invalid, "no id"
};