From ad42adb5fa9dc18f8835933f723aa3f4ed0434c2 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 27 Sep 2014 12:04:54 +0100 Subject: Removed polarSSL makefile. Fixes #591. Also normalises polarssl submodule URL. --- .gitmodules | 2 +- lib/polarssl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 8e63ee0a9..33649023e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ url = https://github.com/bearbin/transapi.git [submodule "lib/polarssl"] path = lib/polarssl - url = https://github.com/mc-server/polarssl + url = https://github.com/mc-server/polarssl.git [submodule "lib/SQLiteCpp"] path = lib/SQLiteCpp url = https://github.com/mc-server/SQLiteCpp.git diff --git a/lib/polarssl b/lib/polarssl index 1ed82759c..d6a15321a 160000 --- a/lib/polarssl +++ b/lib/polarssl @@ -1 +1 @@ -Subproject commit 1ed82759c68f92c4acc7e3f33b850cf9f01c8aba +Subproject commit d6a15321ae51762098e49a976d26efa2493c94f6 -- cgit v1.2.3 From 30f9a4d3abf9cf7f2b7b9f38d46bbb497e8f6b93 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Sat, 27 Sep 2014 14:19:45 +0200 Subject: Fixed convertToPickups for doors --- src/Blocks/BlockDoor.h | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index b2f9e4dcd..af6eee290 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -55,7 +55,44 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { - a_Pickups.push_back(cItem((m_BlockType == E_BLOCK_WOODEN_DOOR) ? E_ITEM_WOODEN_DOOR : E_ITEM_IRON_DOOR, 1, 0)); + switch (m_BlockType) + { + case E_BLOCK_WOODEN_DOOR: + { + a_Pickups.Add(E_ITEM_WOODEN_DOOR); + break; + } + case E_BLOCK_ACACIA_DOOR: + { + a_Pickups.Add(E_ITEM_ACACIA_DOOR); + break; + } + case E_BLOCK_BIRCH_DOOR: + { + a_Pickups.Add(E_ITEM_BIRCH_DOOR); + break; + } + case E_BLOCK_DARK_OAK_DOOR: + { + a_Pickups.Add(E_ITEM_DARK_OAK_DOOR); + break; + } + case E_BLOCK_JUNGLE_DOOR: + { + a_Pickups.Add(E_ITEM_JUNGLE_DOOR); + break; + } + case E_BLOCK_SPRUCE_DOOR: + { + a_Pickups.Add(E_ITEM_SPRUCE_DOOR); + break; + } + case E_BLOCK_IRON_DOOR: + { + a_Pickups.Add(E_ITEM_IRON_DOOR); + break; + } + } } -- cgit v1.2.3 From 485bac281880e5828a8359b0197608f9bb964bb7 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Sat, 27 Sep 2014 14:23:58 +0200 Subject: Fixed convertToPickups for fence gates --- src/Blocks/BlockFenceGate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Blocks/BlockFenceGate.h b/src/Blocks/BlockFenceGate.h index 3041dd46c..b5c1323bd 100644 --- a/src/Blocks/BlockFenceGate.h +++ b/src/Blocks/BlockFenceGate.h @@ -19,7 +19,7 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { - a_Pickups.Add(E_BLOCK_FENCE_GATE, 1, 0); // Reset meta to zero + a_Pickups.Add(m_BlockType, 1, 0); // Reset meta to zero } -- cgit v1.2.3 From 6dd47e783af33cc7eecaf1837899c213bc09f954 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Sat, 27 Sep 2014 15:11:35 +0200 Subject: Added default value to switch and spruce gate to fence gate handler --- src/Blocks/BlockDoor.h | 5 +++++ src/Blocks/BlockHandler.cpp | 1 + 2 files changed, 6 insertions(+) diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index af6eee290..0ff8bcfc8 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -92,6 +92,11 @@ public: a_Pickups.Add(E_ITEM_IRON_DOOR); break; } + default: + { + ASSERT(!"Unhandled door type!"); + break; + } } } diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index 7bfff0545..ff0b201e7 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -294,6 +294,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_SIGN_POST: return new cBlockSignPostHandler (a_BlockType); case E_BLOCK_SNOW: return new cBlockSnowHandler (a_BlockType); case E_BLOCK_SPRUCE_DOOR: return new cBlockDoorHandler (a_BlockType); + case E_BLOCK_SPRUCE_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType); case E_BLOCK_SPRUCE_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType); case E_BLOCK_STAINED_GLASS: return new cBlockGlassHandler (a_BlockType); case E_BLOCK_STAINED_GLASS_PANE: return new cBlockGlassHandler (a_BlockType); -- cgit v1.2.3 From 4f8818748e8b32bc58e251bbd359216554c3e6c6 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 27 Sep 2014 14:46:50 +0100 Subject: Add data accessor. --- src/Chunk.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Chunk.h b/src/Chunk.h index b525fbb82..bc66b6528 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -421,6 +421,7 @@ public: cSandSimulatorChunkData & GetSandSimulatorData (void) { return m_SandSimulatorData; } cRedstoneSimulatorChunkData * GetRedstoneSimulatorData(void) { return m_RedstoneSimulatorData; } + void SetRedstoneSimulatorData(cRedstoneSimulatorChunkData * a_Data) { m_RedstoneSimulatorData = a_Data; } bool IsRedstoneDirty(void) const { return m_IsRedstoneDirty; } void SetIsRedstoneDirty(bool a_Flag) { m_IsRedstoneDirty = a_Flag; } -- cgit v1.2.3 From 94a0d04d58110d3a54669c0b7bbb7f0a618a60bd Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 27 Sep 2014 14:49:03 +0100 Subject: Set chunk data --- src/Simulator/IncrementalRedstoneSimulator.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Simulator/IncrementalRedstoneSimulator.inc b/src/Simulator/IncrementalRedstoneSimulator.inc index 6fda9824c..ba67d4014 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.inc +++ b/src/Simulator/IncrementalRedstoneSimulator.inc @@ -554,6 +554,11 @@ template class Get void cIncrementalRedstoneSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, ChunkType * a_Chunk) { m_RedstoneSimulatorChunkData = (cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData(); + if (m_RedstoneSimulatorChunkData == NULL) + { + m_RedstoneSimulatorChunkData = new cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData(); + a_Chunk->SetRedstoneChunkData(m_RedstoneSimulatorChunkData); + } if (m_RedstoneSimulatorChunkData->m_ChunkData.empty() && ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_QueuedChunkData.empty()) { return; -- cgit v1.2.3 From 20101fab996a8c84225508502cfbe8491a7bb0ac Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 27 Sep 2014 15:04:08 +0100 Subject: Correct method name. --- src/Simulator/IncrementalRedstoneSimulator.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simulator/IncrementalRedstoneSimulator.inc b/src/Simulator/IncrementalRedstoneSimulator.inc index ba67d4014..c5cfbe3ed 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.inc +++ b/src/Simulator/IncrementalRedstoneSimulator.inc @@ -557,7 +557,7 @@ void cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData(); - a_Chunk->SetRedstoneChunkData(m_RedstoneSimulatorChunkData); + a_Chunk->SetRedstoneData(m_RedstoneSimulatorChunkData); } if (m_RedstoneSimulatorChunkData->m_ChunkData.empty() && ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_QueuedChunkData.empty()) { -- cgit v1.2.3 From 88a07bd18461e04ca57b049ac6dff7deada5d298 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 27 Sep 2014 15:19:32 +0100 Subject: Update IncrementalRedstoneSimulator.inc --- src/Simulator/IncrementalRedstoneSimulator.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simulator/IncrementalRedstoneSimulator.inc b/src/Simulator/IncrementalRedstoneSimulator.inc index c5cfbe3ed..299656b85 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.inc +++ b/src/Simulator/IncrementalRedstoneSimulator.inc @@ -557,7 +557,7 @@ void cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData(); - a_Chunk->SetRedstoneData(m_RedstoneSimulatorChunkData); + a_Chunk->SetRedstoneSimulatorData(m_RedstoneSimulatorChunkData); } if (m_RedstoneSimulatorChunkData->m_ChunkData.empty() && ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_QueuedChunkData.empty()) { -- cgit v1.2.3 From cc73b70211ecab462edd373ebfd9f917250321c7 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 27 Sep 2014 15:24:01 +0100 Subject: Update IncrementalRedstoneSimulator.inc --- src/Simulator/IncrementalRedstoneSimulator.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simulator/IncrementalRedstoneSimulator.inc b/src/Simulator/IncrementalRedstoneSimulator.inc index 299656b85..adaa47967 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.inc +++ b/src/Simulator/IncrementalRedstoneSimulator.inc @@ -77,7 +77,7 @@ private: }; class cIncrementalRedstoneSimulatorChunkData : - cRedstoneSimulatorChunkData + public cRedstoneSimulatorChunkData { public: /// Per-chunk data for the simulator, specified individual chunks to simulate -- cgit v1.2.3 From c40f65ad83d3e873e4831fc3a39b2c86a96ebd05 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 27 Sep 2014 15:29:11 +0100 Subject: Update creatable.cpp --- tests/Redstone/creatable.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Redstone/creatable.cpp b/tests/Redstone/creatable.cpp index f26ebe85c..02c622788 100644 --- a/tests/Redstone/creatable.cpp +++ b/tests/Redstone/creatable.cpp @@ -99,6 +99,7 @@ class MockChunk { public: cRedstoneSimulatorChunkData * GetRedstoneSimulatorData() { return NULL; } + void SetRedstoneSimulatorData(cRedstoneSimulatorChunkData * a_Data) {} bool IsRedstoneDirty() { return true; } void SetIsRedstoneDirty(bool a_Param) {} -- cgit v1.2.3