diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-24 22:15:48 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-24 22:15:48 +0200 |
commit | bd5df3d3b975c448e3d8f4227d86a742d0ad3b12 (patch) | |
tree | 30193169848d8ea39e2e5a423bd9e1a8e189c5f6 /src/BlockInfo.cpp | |
parent | Conforms to standards (diff) | |
parent | Merge pull request #1125 from Howaner/Entities (diff) | |
download | cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.gz cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.bz2 cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.lz cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.xz cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.zst cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.zip |
Diffstat (limited to 'src/BlockInfo.cpp')
-rw-r--r-- | src/BlockInfo.cpp | 21 |
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; - - - - - |