From 7bdbfad1bbabb84e650261ad31d2d9b47f8b12a9 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Thu, 17 Aug 2017 08:48:38 -0500 Subject: Changed int parameters to vector parameters in cCuboid and simulators (#3874) --- src/Simulator/SandSimulator.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Simulator/SandSimulator.cpp') diff --git a/src/Simulator/SandSimulator.cpp b/src/Simulator/SandSimulator.cpp index 6b1219edb..c26452d98 100644 --- a/src/Simulator/SandSimulator.cpp +++ b/src/Simulator/SandSimulator.cpp @@ -101,15 +101,15 @@ bool cSandSimulator::IsAllowedBlock(BLOCKTYPE a_BlockType) -void cSandSimulator::AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) +void cSandSimulator::AddBlock(Vector3i a_Block, cChunk * a_Chunk) { if ((a_Chunk == nullptr) || !a_Chunk->IsValid()) { return; } - int RelX = a_BlockX - a_Chunk->GetPosX() * cChunkDef::Width; - int RelZ = a_BlockZ - a_Chunk->GetPosZ() * cChunkDef::Width; - if (!IsAllowedBlock(a_Chunk->GetBlock(RelX, a_BlockY, RelZ))) + int RelX = a_Block.x - a_Chunk->GetPosX() * cChunkDef::Width; + int RelZ = a_Block.z - a_Chunk->GetPosZ() * cChunkDef::Width; + if (!IsAllowedBlock(a_Chunk->GetBlock(RelX, a_Block.y, RelZ))) { return; } @@ -118,14 +118,14 @@ void cSandSimulator::AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * cSandSimulatorChunkData & ChunkData = a_Chunk->GetSandSimulatorData(); for (cSandSimulatorChunkData::iterator itr = ChunkData.begin(); itr != ChunkData.end(); ++itr) { - if ((itr->x == RelX) && (itr->y == a_BlockY) && (itr->z == RelZ)) + if ((itr->x == RelX) && (itr->y == a_Block.y) && (itr->z == RelZ)) { return; } } m_TotalBlocks += 1; - ChunkData.push_back(cCoordWithInt(RelX, a_BlockY, RelZ)); + ChunkData.push_back(cCoordWithInt(RelX, a_Block.y, RelZ)); } -- cgit v1.2.3