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:
parent
ec30d49e02
commit
6647939403
8 changed files with 88 additions and 117 deletions
|
@ -146,8 +146,8 @@ public:
|
|||
|
||||
virtual void setArmorGroups(const ItemGroupList &armor_groups)
|
||||
{}
|
||||
virtual ItemGroupList getArmorGroups()
|
||||
{ return ItemGroupList(); }
|
||||
virtual const ItemGroupList &getArmorGroups()
|
||||
{ static const ItemGroupList rv; return rv; }
|
||||
virtual void setPhysicsOverride(float physics_override_speed, float physics_override_jump, float physics_override_gravity)
|
||||
{}
|
||||
virtual void setAnimation(v2f frames, float frame_speed, float frame_blend, bool frame_loop)
|
||||
|
@ -166,8 +166,8 @@ public:
|
|||
{}
|
||||
virtual void removeAttachmentChild(int child_id)
|
||||
{}
|
||||
virtual UNORDERED_SET<int> getAttachmentChildIds()
|
||||
{ return UNORDERED_SET<int>(); }
|
||||
virtual const UNORDERED_SET<int> &getAttachmentChildIds()
|
||||
{ static const UNORDERED_SET<int> rv; return rv; }
|
||||
virtual ObjectProperties* accessObjectProperties()
|
||||
{ return NULL; }
|
||||
virtual void notifyObjectPropertiesModified()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue