summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Generating/StructGen.cpp28
-rw-r--r--src/Mobs/Monster.cpp2
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp37
3 files changed, 35 insertions, 32 deletions
diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp
index db9d5578c..636364e17 100644
--- a/src/Generating/StructGen.cpp
+++ b/src/Generating/StructGen.cpp
@@ -596,24 +596,22 @@ void cStructGenDirectOverhangs::GenFinish(cChunkDesc & a_ChunkDesc)
// Interpolate between FloorLo and FloorHi:
for (int z = 0; z < 16; z++) for (int x = 0; x < 16; x++)
{
- switch (a_ChunkDesc.GetBiome(x, z))
+ EMCSBiome biome = a_ChunkDesc.GetBiome(x, z);
+
+ if ((biome == biExtremeHills) || (biome == biExtremeHillsEdge))
{
- case biExtremeHills:
- case biExtremeHillsEdge:
+ int Lo = FloorLo[x + 17 * z] / 256;
+ int Hi = FloorHi[x + 17 * z] / 256;
+ for (int y = 0; y < SEGMENT_HEIGHT; y++)
{
- int Lo = FloorLo[x + 17 * z] / 256;
- int Hi = FloorHi[x + 17 * z] / 256;
- for (int y = 0; y < SEGMENT_HEIGHT; y++)
+ int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT;
+ if (Val < 0)
{
- int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT;
- if (Val < 0)
- {
- a_ChunkDesc.SetBlockType(x, y + Segment, z, E_BLOCK_AIR);
- }
- } // for y
- break;
- }
- } // switch (biome)
+ a_ChunkDesc.SetBlockType(x, y + Segment, z, E_BLOCK_AIR);
+ }
+ } // for y
+ break;
+ } // if (biome)
} // for z, x
// Swap the floors:
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 62670907f..5832edb9f 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -355,6 +355,8 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
InStateEscaping(a_Dt);
break;
}
+
+ case ATTACKING: break;
} // switch (m_EMState)
BroadcastMovementUpdate();
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 2ac1d7962..ab80dd7c8 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -391,38 +391,41 @@ void cNBTChunkSerializer::AddFallingBlockEntity(cFallingBlock * a_FallingBlock)
void cNBTChunkSerializer::AddMinecartEntity(cMinecart * a_Minecart)
{
- const char * EntityClass = NULL;
- switch (a_Minecart->GetPayload())
- {
- case cMinecart::mpNone: EntityClass = "MinecartRideable"; break;
- case cMinecart::mpChest: EntityClass = "MinecartChest"; break;
- case cMinecart::mpFurnace: EntityClass = "MinecartFurnace"; break;
- case cMinecart::mpTNT: EntityClass = "MinecartTNT"; break;
- case cMinecart::mpHopper: EntityClass = "MinecartHopper"; break;
- default:
- {
- ASSERT(!"Unhandled minecart payload type");
- return;
- }
- } // switch (payload)
-
m_Writer.BeginCompound("");
- AddBasicEntity(a_Minecart, EntityClass);
+
switch (a_Minecart->GetPayload())
{
case cMinecart::mpChest:
{
+ AddBasicEntity(a_Minecart, "MinecartChest");
// Add chest contents into the Items tag:
AddMinecartChestContents((cMinecartWithChest *)a_Minecart);
break;
}
-
case cMinecart::mpFurnace:
{
+ AddBasicEntity(a_Minecart, "MinecartFurnace");
// TODO: Add "Push" and "Fuel" tags
break;
}
+ case cMinecart::mpHopper:
+ {
+ AddBasicEntity(a_Minecart, "MinecartHopper");
+ // TODO: Add hopper contents?
+ break;
+ }
+ case cMinecart::mpTNT:
+ {
+ AddBasicEntity(a_Minecart, "MinecartTNT");
+ break;
+ }
+ case cMinecart::mpNone:
+ {
+ AddBasicEntity(a_Minecart, "MinecartRideable");
+ break;
+ }
} // switch (Payload)
+
m_Writer.EndCompound();
}