summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-11-26 10:14:11 +0100
committerMattes D <github@xoft.cz>2014-11-26 10:14:11 +0100
commit0ca891da6d7b527cdd8a34332d7a8acd99e7caf3 (patch)
tree766a13c416a434950c7b210b7c369e52d93395b7 /src/WorldStorage/WSSAnvil.cpp
parentMerge pull request #1617 from mc-server/ReachDistance (diff)
downloadcuberite-0ca891da6d7b527cdd8a34332d7a8acd99e7caf3.tar
cuberite-0ca891da6d7b527cdd8a34332d7a8acd99e7caf3.tar.gz
cuberite-0ca891da6d7b527cdd8a34332d7a8acd99e7caf3.tar.bz2
cuberite-0ca891da6d7b527cdd8a34332d7a8acd99e7caf3.tar.lz
cuberite-0ca891da6d7b527cdd8a34332d7a8acd99e7caf3.tar.xz
cuberite-0ca891da6d7b527cdd8a34332d7a8acd99e7caf3.tar.zst
cuberite-0ca891da6d7b527cdd8a34332d7a8acd99e7caf3.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/WSSAnvil.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 0c77b4d67..395aabb1b 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -1807,9 +1807,10 @@ void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
int InBlockZIdx = a_NBT.FindChildByName(a_TagIdx, "zTile");
if ((InBlockXIdx > 0) && (InBlockYIdx > 0) && (InBlockZIdx > 0))
{
- if (a_NBT.GetType(InBlockXIdx) == a_NBT.GetType(InBlockYIdx) == a_NBT.GetType(InBlockZIdx))
+ eTagType typeX = a_NBT.GetType(InBlockXIdx);
+ if ((typeX == a_NBT.GetType(InBlockYIdx)) && (typeX == a_NBT.GetType(InBlockZIdx)))
{
- switch (a_NBT.GetType(InBlockXIdx))
+ switch (typeX)
{
case TAG_Int:
{
@@ -1823,6 +1824,11 @@ void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
Arrow->SetBlockHit(Vector3i((int)a_NBT.GetShort(InBlockXIdx), (int)a_NBT.GetShort(InBlockYIdx), (int)a_NBT.GetShort(InBlockZIdx)));
break;
}
+ default:
+ {
+ // No hit block, the arrow is still flying?
+ break;
+ }
}
}
}