summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-09-30 19:06:52 +0200
committerMattes D <github@xoft.cz>2015-10-15 10:53:32 +0200
commit979ab110447f8d4a56cfb9f54fed799b40f58cc6 (patch)
tree37b4dd2176e856d9624cfcde88ab4a722677e296
parentMerge pull request #2544 from cuberite/worktycho-patch-1 (diff)
downloadcuberite-979ab110447f8d4a56cfb9f54fed799b40f58cc6.tar
cuberite-979ab110447f8d4a56cfb9f54fed799b40f58cc6.tar.gz
cuberite-979ab110447f8d4a56cfb9f54fed799b40f58cc6.tar.bz2
cuberite-979ab110447f8d4a56cfb9f54fed799b40f58cc6.tar.lz
cuberite-979ab110447f8d4a56cfb9f54fed799b40f58cc6.tar.xz
cuberite-979ab110447f8d4a56cfb9f54fed799b40f58cc6.tar.zst
cuberite-979ab110447f8d4a56cfb9f54fed799b40f58cc6.zip
-rw-r--r--src/BlockID.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/BlockID.h b/src/BlockID.h
index b7d844057..98c296249 100644
--- a/src/BlockID.h
+++ b/src/BlockID.h
@@ -3,12 +3,13 @@
// The following hackery is to allow typed C++ enum for C++ code, yet have ToLua process the values.
// ToLua doesn't understand typed enums, so we use preprocessor to hide it from ToLua.
-enum ENUM_BLOCK_ID : BLOCKTYPE
+
+static const BLOCKTYPE
#if 0
-enum ENUM_BLOCK_ID // tolua_export
-#endif
// tolua_begin
+enum BLOCKTYPE
{
+#endif
E_BLOCK_AIR = 0,
E_BLOCK_STONE = 1,
E_BLOCK_GRASS = 2,
@@ -215,9 +216,9 @@ enum ENUM_BLOCK_ID // tolua_export
E_BLOCK_ACACIA_DOOR = 196,
E_BLOCK_DARK_OAK_DOOR = 197,
- // Keep these two as the last values, without a number - they will get their correct number assigned automagically by C++
+ // Keep these two as the last values. Update the last block value when adding another block
// IsValidBlock() depends on this
- E_BLOCK_NUMBER_OF_TYPES, ///< Number of individual (different) blocktypes
+ E_BLOCK_NUMBER_OF_TYPES = E_BLOCK_DARK_OAK_DOOR + 1, ///< Number of individual (different) blocktypes
E_BLOCK_MAX_TYPE_ID = E_BLOCK_NUMBER_OF_TYPES - 1, ///< Maximum BlockType number used
// Synonym or ID compatibility
@@ -225,8 +226,12 @@ enum ENUM_BLOCK_ID // tolua_export
E_BLOCK_RED_ROSE = E_BLOCK_FLOWER,
E_BLOCK_WOODEN_DOOR = E_BLOCK_OAK_DOOR,
E_BLOCK_FENCE_GATE = E_BLOCK_OAK_FENCE_GATE,
- E_BLOCK_WOODEN_STAIRS = E_BLOCK_OAK_WOOD_STAIRS,
-};
+ E_BLOCK_WOODEN_STAIRS = E_BLOCK_OAK_WOOD_STAIRS
+
+#if 0
+}
+#endif
+ ;
// tolua_end