File tree Expand file tree Collapse file tree
Core/GameEngine/Source/GameLogic/AI Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11338,10 +11338,20 @@ void Pathfinder::crc( Xfer *xfer )
1133811338
1133911339 xfer->xferInt (&m_numWallPieces);
1134011340 CRCDEBUG_LOG ((" m_numWallPieces: %8.8X" , ((XferCRC *)xfer)->getCRC ()));
11341- for (Int i=0 ; i<MAX_WALL_PIECES; ++i)
11341+
11342+ #if RETAIL_COMPATIBLE_CRC
11343+ // TheSuperHackers @fix The original code effectively accessed m_numWallPieces 128 times,
11344+ // because it used &m_wallPieces[MAX_WALL_PIECES] which is out-of-bounds and points to m_numWallPieces.
11345+ static_assert (sizeof (Int) == sizeof (ObjectID), " Type sizes must be equal for correct xfer" );
11346+
11347+ for (Int i = 0 ; i < MAX_WALL_PIECES; ++i)
1134211348 {
11343- xfer->xferObjectID (&m_wallPieces[MAX_WALL_PIECES] );
11349+ xfer->xferInt (&m_numWallPieces );
1134411350 }
11351+ #else
11352+ xfer->xferUser (m_wallPieces, sizeof (m_wallPieces));
11353+ #endif
11354+
1134511355 CRCDEBUG_LOG ((" m_wallPieces: %8.8X" , ((XferCRC *)xfer)->getCRC ()));
1134611356
1134711357 xfer->xferReal (&m_wallHeight);
You can’t perform that action at this time.
0 commit comments