From 622b960b10dd79909b723905848aba640168e1c2 Mon Sep 17 00:00:00 2001 From: Scott Ludwig Date: Wed, 13 Jan 2016 22:25:34 -0800 Subject: [PATCH] Fix 32 bit / 64 bit multiplayer interop problem - Fix gids to be calculated the same on 32 bit and 64 bit platforms. Previously they were byte offsets into a pointer array, which meant multiple of 4 on 32 bit platforms, and multiple of 8 on 64 bit platforms. Now they are indexes. --- game/GameObjects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/GameObjects.cpp b/game/GameObjects.cpp index 97c3708..c701abd 100644 --- a/game/GameObjects.cpp +++ b/game/GameObjects.cpp @@ -1281,8 +1281,8 @@ Direction16 CalcDir16(int dx, int dy) // GobMgr implementation // -#define PpgobFromGid(gid) ((Gob **)((byte *)m_apgobMaster + (gid))) -#define GidFromPpgob(ppgob) ((byte *)(ppgob) - (byte *)m_apgobMaster) +#define PpgobFromGid(gid) (&m_apgobMaster[gid]) +#define GidFromPpgob(ppgob) ((ppgob) - m_apgobMaster) #define MakeUsedEntry(pw) (Gob **)((pword)(pw) & ~1) #define MakeFreeEntry(pw) (Gob *)((pword)(pw) | 1) #define IsFreeEntry(pw) ((pword)(pw) & 1)