mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Optimize getting active objects a bit. #8674
This commit is contained in:
parent
41229696be
commit
9fe3246154
3 changed files with 11 additions and 6 deletions
|
@ -90,10 +90,10 @@ private:
|
|||
static std::unordered_map<u16, Factory> m_types;
|
||||
};
|
||||
|
||||
struct DistanceSortedActiveObject
|
||||
class DistanceSortedActiveObject
|
||||
{
|
||||
public:
|
||||
ClientActiveObject *obj;
|
||||
f32 d;
|
||||
|
||||
DistanceSortedActiveObject(ClientActiveObject *a_obj, f32 a_d)
|
||||
{
|
||||
|
@ -105,4 +105,7 @@ struct DistanceSortedActiveObject
|
|||
{
|
||||
return d < other.d;
|
||||
}
|
||||
|
||||
private:
|
||||
f32 d;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue