summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules2
m---------lib/polarssl0
-rw-r--r--src/Blocks/BlockDoor.h44
-rw-r--r--src/Blocks/BlockFenceGate.h2
-rw-r--r--src/Blocks/BlockHandler.cpp1
-rw-r--r--src/Chunk.h1
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.inc7
-rw-r--r--tests/Redstone/creatable.cpp1
8 files changed, 54 insertions, 4 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
-Subproject 1ed82759c68f92c4acc7e3f33b850cf9f01c8ab
+Subproject d6a15321ae51762098e49a976d26efa2493c94f
diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h
index b2f9e4dcd..0ff8bcfc8 100644
--- a/src/Blocks/BlockDoor.h
+++ b/src/Blocks/BlockDoor.h
@@ -55,7 +55,49 @@ 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;
+ }
+ default:
+ {
+ ASSERT(!"Unhandled door type!");
+ break;
+ }
+ }
}
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
}
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);
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; }
diff --git a/src/Simulator/IncrementalRedstoneSimulator.inc b/src/Simulator/IncrementalRedstoneSimulator.inc
index 6fda9824c..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
@@ -554,6 +554,11 @@ template <class ChunkType, class WorldType, template <BLOCKTYPE block> class Get
void cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, ChunkType * a_Chunk)
{
m_RedstoneSimulatorChunkData = (cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData();
+ if (m_RedstoneSimulatorChunkData == NULL)
+ {
+ m_RedstoneSimulatorChunkData = new cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData();
+ a_Chunk->SetRedstoneSimulatorData(m_RedstoneSimulatorChunkData);
+ }
if (m_RedstoneSimulatorChunkData->m_ChunkData.empty() && ((cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_QueuedChunkData.empty())
{
return;
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) {}