Skip to content

Commit 6832bf0

Browse files
lhofhanslsfan5numberZero
authored
Avoid jittering when player is attached (luanti-org#12439)
* Avoid very jittering when player is attached. Co-authored-by: sfan5 <[email protected]> Co-authored-by: Vitaliy <[email protected]>
1 parent 394dd9f commit 6832bf0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/activeobjectmgr.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
1919

2020
#pragma once
2121

22-
#include <unordered_map>
22+
#include <map>
2323
#include "irrlichttypes.h"
2424

2525
class TestClientActiveObjectMgr;
@@ -38,8 +38,7 @@ class ActiveObjectMgr
3838

3939
T *getActiveObject(u16 id)
4040
{
41-
typename std::unordered_map<u16, T *>::const_iterator n =
42-
m_active_objects.find(id);
41+
auto n = m_active_objects.find(id);
4342
return (n != m_active_objects.end() ? n->second : nullptr);
4443
}
4544

@@ -62,5 +61,5 @@ class ActiveObjectMgr
6261
return id != 0 && m_active_objects.find(id) == m_active_objects.end();
6362
}
6463

65-
std::unordered_map<u16, T *> m_active_objects;
64+
std::map<u16, T *> m_active_objects; // ordered to fix #10985
6665
};

0 commit comments

Comments
 (0)