Jump to content

[Fix][8145] Use MAX_NUMBER_OF_CELLS for NGridType


Recommended Posts

Posted
diff --git a/src/game/GridDefines.h b/src/game/GridDefines.h
index d5ddf3a..9d704f9 100644
--- a/src/game/GridDefines.h
+++ b/src/game/GridDefines.h
@@ -65,7 +65,8 @@ typedef GridRefManager<GameObject>      GameObjectMapType;
typedef GridRefManager<Player>          PlayerMapType;

typedef Grid<Player, AllWorldObjectTypes,AllGridObjectTypes> GridType;
-typedef NGrid<8, Player, AllWorldObjectTypes, AllGridObjectTypes> NGridType;
+// use MAX_NUMBER_OF_CELLS to sync with changes in defines
+typedef NGrid<MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes> NGridType;

typedef TypeMapContainer<AllGridObjectTypes> GridTypeMapContainer;
typedef TypeMapContainer<AllWorldObjectTypes> WorldTypeMapContainer;

I noticed that the typedef for NGridType was never updated to reflect changes to the MAX_NUMBER_OF_CELLS #define. I think this might be the cause of many weird things, possibly even crashes.

Posted

Similar patch I already suggested to devs today. Thanks :) It is not cause of crashes. This is the reason why we cannot have MAX_NUMBER_OF_CELLS > 8 if not fixed

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use