1
0

BlockHandler initialisation is a constant expression (#4891)

* BlockHandler initialisation is a constant expression

If we can't make it all namespaces, this is the next best I guess.

+ Tag handlers constexpr, const as needed
+ Inherit constructors
* Privatise handler functions

* More constexpr

Co-authored-by: Alexander Harkness <me@bearbin.net>
This commit is contained in:
Tiger Wang
2020-09-20 14:50:52 +01:00
committed by GitHub
parent 6a0669fb98
commit 68cced73af
115 changed files with 1773 additions and 2242 deletions

View File

@@ -299,8 +299,7 @@ void cFloodyFluidSimulator::SpreadToNeighbor(cChunk * a_NearChunk, int a_RelX, i
// Wash away the block there, if possible:
if (CanWashAway(BlockType))
{
cBlockHandler * Handler = BlockHandler(BlockType);
if (Handler->DoesDropOnUnsuitable())
if (cBlockHandler::For(BlockType).DoesDropOnUnsuitable())
{
m_World.DropBlockAsPickups(absPos, nullptr, nullptr);
}