diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-14 09:00:24 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-14 09:00:24 +0100 |
commit | e18e539ad263d24e59d2930e51a76abc18e74bad (patch) | |
tree | dc267a26ba396946ddcf21c2d10db05be5dc889f | |
parent | AnvilStats: Added module for counting water and lava springs. (diff) | |
download | cuberite-e18e539ad263d24e59d2930e51a76abc18e74bad.tar cuberite-e18e539ad263d24e59d2930e51a76abc18e74bad.tar.gz cuberite-e18e539ad263d24e59d2930e51a76abc18e74bad.tar.bz2 cuberite-e18e539ad263d24e59d2930e51a76abc18e74bad.tar.lz cuberite-e18e539ad263d24e59d2930e51a76abc18e74bad.tar.xz cuberite-e18e539ad263d24e59d2930e51a76abc18e74bad.tar.zst cuberite-e18e539ad263d24e59d2930e51a76abc18e74bad.zip |
Diffstat (limited to '')
-rw-r--r-- | source/ChunkDef.h | 5 | ||||
-rw-r--r-- | source/Simulator/DelayedFluidSimulator.cpp | 10 | ||||
-rw-r--r-- | source/Simulator/DelayedFluidSimulator.h | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/source/ChunkDef.h b/source/ChunkDef.h index 927957e07..1e368b50b 100644 --- a/source/ChunkDef.h +++ b/source/ChunkDef.h @@ -538,8 +538,9 @@ public: } ; // Illegal in C++03: typedef std::list< cCoordWithData<X> > cCoordWithDataList<X>; -typedef cCoordWithData<int> cCoordWithInt; -typedef std::list<cCoordWithInt> cCoordWithIntList; +typedef cCoordWithData<int> cCoordWithInt; +typedef std::list<cCoordWithInt> cCoordWithIntList; +typedef std::vector<cCoordWithInt> cCoordWithIntVector; diff --git a/source/Simulator/DelayedFluidSimulator.cpp b/source/Simulator/DelayedFluidSimulator.cpp index be0cc1bbc..f6b3e5547 100644 --- a/source/Simulator/DelayedFluidSimulator.cpp +++ b/source/Simulator/DelayedFluidSimulator.cpp @@ -18,7 +18,7 @@ // cDelayedFluidSimulatorChunkData:
cDelayedFluidSimulatorChunkData::cDelayedFluidSimulatorChunkData(int a_TickDelay) :
- m_Slots(new cCoordWithIntList[a_TickDelay])
+ m_Slots(new cCoordWithIntVector[a_TickDelay])
{
}
@@ -75,10 +75,10 @@ void cDelayedFluidSimulator::AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, void * ChunkDataRaw = (m_FluidBlock == E_BLOCK_WATER) ? a_Chunk->GetWaterSimulatorData() : a_Chunk->GetLavaSimulatorData();
cDelayedFluidSimulatorChunkData * ChunkData = (cDelayedFluidSimulatorChunkData *)ChunkDataRaw;
- cCoordWithIntList & Blocks = ChunkData->m_Slots[m_AddSlotNum];
+ cCoordWithIntVector & Blocks = ChunkData->m_Slots[m_AddSlotNum];
// Check for duplicates:
- for (cCoordWithIntList::iterator itr = Blocks.begin(), end = Blocks.end(); itr != end; ++itr)
+ for (cCoordWithIntVector::iterator itr = Blocks.begin(), end = Blocks.end(); itr != end; ++itr)
{
if ((itr->x == RelX) && (itr->y == a_BlockY) && (itr->z == RelZ))
{
@@ -112,10 +112,10 @@ void cDelayedFluidSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_Chunk {
void * ChunkDataRaw = (m_FluidBlock == E_BLOCK_WATER) ? a_Chunk->GetWaterSimulatorData() : a_Chunk->GetLavaSimulatorData();
cDelayedFluidSimulatorChunkData * ChunkData = (cDelayedFluidSimulatorChunkData *)ChunkDataRaw;
- cCoordWithIntList & Blocks = ChunkData->m_Slots[m_SimSlotNum];
+ cCoordWithIntVector & Blocks = ChunkData->m_Slots[m_SimSlotNum];
// Simulate the blocks in the scheduled slot:
- for (cCoordWithIntList::iterator itr = Blocks.begin(), end = Blocks.end(); itr != end; ++itr)
+ for (cCoordWithIntVector::iterator itr = Blocks.begin(), end = Blocks.end(); itr != end; ++itr)
{
SimulateBlock(a_Chunk, itr->x, itr->y, itr->z);
}
diff --git a/source/Simulator/DelayedFluidSimulator.h b/source/Simulator/DelayedFluidSimulator.h index eddaf1040..fc1a59f69 100644 --- a/source/Simulator/DelayedFluidSimulator.h +++ b/source/Simulator/DelayedFluidSimulator.h @@ -23,7 +23,7 @@ public: virtual ~cDelayedFluidSimulatorChunkData();
/// Slots, one for each delay tick, each containing the blocks to simulate; relative coords. Int param not used.
- cCoordWithIntList * m_Slots;
+ cCoordWithIntVector * m_Slots;
} ;
|