Skip to content

Commit edbaac6

Browse files
committed
xrGame: Fixed crashes when loading some saves under Linux
1 parent 0b648a3 commit edbaac6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/xrGame/xrServer.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@ class CSE_Abstract;
2929
constexpr u32 NET_Latency = 50; // time in (ms)
3030

3131
// XXX: check if u16 used for entity's id. If true, then this must be changed, if we want to increase the number of ID's.
32+
#ifdef XR_PLATFORM_WINDOWS
3233
using xrS_entities = xr_unordered_map<u16, CSE_Abstract*>;
34+
#elif defined(XR_PLATFORM_LINUX) || defined(XR_PLATFORM_FREEBSD)
35+
// XXX: For the game engine to work correctly, the actor must always load first, the xr_unordered_map implementation for win
36+
// provides this, but the CPP standard order of elements in the container is not defined, which leads to crashes when
37+
// loading saved game under UNIX
38+
using xrS_entities = xr_map<u16, CSE_Abstract*>;
39+
#else
40+
#error add your platform-specific extension here
41+
#endif
3342

3443
class xrClientData : public IClient
3544
{

0 commit comments

Comments
 (0)