BlockHandler: no dynamic allocation (#4862)

* BlockHandler: no dynamic allocation
This commit is contained in:
Tiger Wang
2020-09-17 14:51:42 +01:00
committed by GitHub
parent 53549a1a4c
commit c3d2956ba5
8 changed files with 557 additions and 254 deletions
+4 -2
View File
@@ -406,7 +406,9 @@ void cItem::Empty()
cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
cBlockHandler & cBlockHandler::GetBlockHandler(BLOCKTYPE a_BlockType)
{
return new cBlockHandler(a_BlockType);
// Dummy handler.
static cBlockHandler Handler(E_BLOCK_AIR);
return Handler;
}