1
0
This commit is contained in:
Tycho 2014-09-26 18:14:22 +01:00
commit 0e141923bb
3 changed files with 8 additions and 3 deletions

View File

@ -92,6 +92,7 @@ cChunk::cChunk(
m_NeighborZP(a_NeighborZP), m_NeighborZP(a_NeighborZP),
m_WaterSimulatorData(a_World->GetWaterSimulator()->CreateChunkData()), m_WaterSimulatorData(a_World->GetWaterSimulator()->CreateChunkData()),
m_LavaSimulatorData (a_World->GetLavaSimulator ()->CreateChunkData()), m_LavaSimulatorData (a_World->GetLavaSimulator ()->CreateChunkData()),
m_RedstoneSimulatorData(NULL),
m_AlwaysTicked(0) m_AlwaysTicked(0)
{ {
if (a_NeighborXM != NULL) if (a_NeighborXM != NULL)
@ -160,6 +161,8 @@ cChunk::~cChunk()
m_WaterSimulatorData = NULL; m_WaterSimulatorData = NULL;
delete m_LavaSimulatorData; delete m_LavaSimulatorData;
m_LavaSimulatorData = NULL; m_LavaSimulatorData = NULL;
delete m_RedstoneSimulatorData;
m_RedstoneSimulatorData = NULL;
} }

View File

@ -420,7 +420,7 @@ public:
cFluidSimulatorData * GetLavaSimulatorData (void) { return m_LavaSimulatorData; } cFluidSimulatorData * GetLavaSimulatorData (void) { return m_LavaSimulatorData; }
cSandSimulatorChunkData & GetSandSimulatorData (void) { return m_SandSimulatorData; } cSandSimulatorChunkData & GetSandSimulatorData (void) { return m_SandSimulatorData; }
cRedstoneSimulatorChunkData * GetRedstoneSimulatorData(void) { return &m_RedstoneSimulatorData; } cRedstoneSimulatorChunkData * GetRedstoneSimulatorData(void) { return m_RedstoneSimulatorData; }
bool IsRedstoneDirty(void) const { return m_IsRedstoneDirty; } bool IsRedstoneDirty(void) const { return m_IsRedstoneDirty; }
void SetIsRedstoneDirty(bool a_Flag) { m_IsRedstoneDirty = a_Flag; } void SetIsRedstoneDirty(bool a_Flag) { m_IsRedstoneDirty = a_Flag; }
@ -505,7 +505,7 @@ private:
cFluidSimulatorData * m_LavaSimulatorData; cFluidSimulatorData * m_LavaSimulatorData;
cSandSimulatorChunkData m_SandSimulatorData; cSandSimulatorChunkData m_SandSimulatorData;
cRedstoneSimulatorChunkData m_RedstoneSimulatorData; cRedstoneSimulatorChunkData * m_RedstoneSimulatorData;
/** Indicates if simulate-once blocks should be updated by the redstone simulator */ /** Indicates if simulate-once blocks should be updated by the redstone simulator */

View File

@ -7,10 +7,12 @@
class cRedstoneSimulatorChunkData class cRedstoneSimulatorChunkData
{ {
public: public:
virtual ~cRedstoneSimulatorChunkData() {} virtual ~cRedstoneSimulatorChunkData() = 0;
} ; } ;
inline cRedstoneSimulatorChunkData::~cRedstoneSimulatorChunkData() {}
template <class ChunkType, class WorldType> template <class ChunkType, class WorldType>
class cRedstoneSimulator : class cRedstoneSimulator :
public cSimulator<ChunkType, WorldType> public cSimulator<ChunkType, WorldType>