summaryrefslogtreecommitdiffstats
path: root/src/BlockInfo.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-06-24 13:48:12 +0200
committermadmaxoft <github@xoft.cz>2014-06-24 13:49:14 +0200
commita1d2c114cf2e9f3a7e54c58d4073c87d0afa76af (patch)
treeec845c0af7d16e26acb5670a271ef6ae1b039785 /src/BlockInfo.cpp
parentAdded asserts for cChunk::GetBlockEntity() coords. (diff)
downloadcuberite-a1d2c114cf2e9f3a7e54c58d4073c87d0afa76af.tar
cuberite-a1d2c114cf2e9f3a7e54c58d4073c87d0afa76af.tar.gz
cuberite-a1d2c114cf2e9f3a7e54c58d4073c87d0afa76af.tar.bz2
cuberite-a1d2c114cf2e9f3a7e54c58d4073c87d0afa76af.tar.lz
cuberite-a1d2c114cf2e9f3a7e54c58d4073c87d0afa76af.tar.xz
cuberite-a1d2c114cf2e9f3a7e54c58d4073c87d0afa76af.tar.zst
cuberite-a1d2c114cf2e9f3a7e54c58d4073c87d0afa76af.zip
Diffstat (limited to '')
-rw-r--r--src/BlockInfo.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp
index 32fdec905..b084d0915 100644
--- a/src/BlockInfo.cpp
+++ b/src/BlockInfo.cpp
@@ -9,6 +9,7 @@
cBlockInfo cBlockInfo::ms_Info[256];
+static bool g_IsBlockInfoInitialized = false;
@@ -43,6 +44,11 @@ cBlockInfo::~cBlockInfo()
cBlockInfo & cBlockInfo::Get(BLOCKTYPE a_Type)
{
+ if (!g_IsBlockInfoInitialized)
+ {
+ cBlockInfo::Initialize();
+ g_IsBlockInfoInitialized = true;
+ }
return ms_Info[a_Type];
}
@@ -448,18 +454,3 @@ void cBlockInfo::Initialize(void)
-
-// This is actually just some code that needs to run at program startup, so it is wrapped into a global var's constructor:
-class cBlockInfoInitializer
-{
-public:
- cBlockInfoInitializer(void)
- {
- cBlockInfo::Initialize();
- }
-} BlockInfoInitializer;
-
-
-
-
-