From 225c2fa9f6bc2ebffcc9160090482e6833a220ce Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 29 Jul 2020 01:18:59 +0100 Subject: Always use relative coordinates in AddBlock + Pass block, use relatives * Fixes everything immediately converting abs back to rel and getting block, when these data were already available --- src/Simulator/FluidSimulator.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Simulator/FluidSimulator.h') diff --git a/src/Simulator/FluidSimulator.h b/src/Simulator/FluidSimulator.h index e9157fa69..2dc499375 100644 --- a/src/Simulator/FluidSimulator.h +++ b/src/Simulator/FluidSimulator.h @@ -43,14 +43,11 @@ public: cFluidSimulator(cWorld & a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid); - // cSimulator overrides: - virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override; - /** Returns a unit vector in the direction the fluid is flowing or a zero-vector if not flowing. */ virtual Vector3f GetFlowingDirection(int a_X, int a_Y, int a_Z); /** Creates a ChunkData object for the simulator to use. The simulator returns the correct object type. */ - virtual cFluidSimulatorData * CreateChunkData(void) { return nullptr; } + virtual cFluidSimulatorData * CreateChunkData(void) = 0; bool IsFluidBlock (BLOCKTYPE a_BlockType) const { return (a_BlockType == m_FluidBlock); } bool IsStationaryFluidBlock(BLOCKTYPE a_BlockType) const { return (a_BlockType == m_StationaryFluidBlock); } @@ -65,6 +62,9 @@ public: bool IsHigherMeta(NIBBLETYPE a_Meta1, NIBBLETYPE a_Meta2); protected: + + bool IsAllowedBlock(BLOCKTYPE a_BlockType); + BLOCKTYPE m_FluidBlock; // The fluid block type that needs simulating BLOCKTYPE m_StationaryFluidBlock; // The fluid block type that indicates no simulation is needed }; -- cgit v1.2.3