diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-07-22 00:40:13 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-08-20 17:15:55 +0200 |
commit | 5751ba0c1c774d69512cad2bd2c17e40b03af31a (patch) | |
tree | 3efe3615509589c8c6360aae490b55c54e4b8d55 /src | |
parent | Merge pull request #2391 from SamJBarney/CropGrowthFix (diff) | |
download | cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.gz cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.bz2 cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.lz cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.xz cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.zst cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Bindings/LuaState.cpp | 2 | ||||
-rw-r--r-- | src/Enchantments.cpp | 4 | ||||
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index 7c0d2a121..7b519a798 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -868,7 +868,7 @@ cLuaState::cStackValue cLuaState::WalkToValue(const AString & a_Name) // Remove the previous value from the stack (keep only the new one): lua_remove(m_LuaState, -2); } // for elem - path[] - return std::move(cStackValue(*this)); + return cStackValue(*this); } diff --git a/src/Enchantments.cpp b/src/Enchantments.cpp index 17c77dd93..34270b2f3 100644 --- a/src/Enchantments.cpp +++ b/src/Enchantments.cpp @@ -1040,7 +1040,7 @@ cEnchantments cEnchantments::SelectEnchantmentFromVector(const cWeightedEnchantm { // Sum up all the enchantments' weights: int AllWeights = 0; - for (const auto Enchantment : a_Enchantments) + for (const auto & Enchantment : a_Enchantments) { AllWeights += Enchantment.m_Weight; } @@ -1054,7 +1054,7 @@ cEnchantments cEnchantments::SelectEnchantmentFromVector(const cWeightedEnchantm // Pick a random enchantment: cNoise Noise(a_Seed); int RandomNumber = Noise.IntNoise1DInt(AllWeights) / 7 % AllWeights; - for (const auto Enchantment : a_Enchantments) + for (const auto & Enchantment : a_Enchantments) { RandomNumber -= Enchantment.m_Weight; if (RandomNumber <= 0) diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index da5c451db..6ebd214d2 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -724,7 +724,7 @@ void cProtocol180::SendMapData(const cMap & a_Map, int a_DataStartX, int a_DataS Pkt.WriteBEUInt8(static_cast<UInt8>(a_Map.GetScale())); Pkt.WriteVarInt32(static_cast<UInt32>(a_Map.GetDecorators().size())); - for (const auto Decorator : a_Map.GetDecorators()) + for (const auto & Decorator : a_Map.GetDecorators()) { Pkt.WriteBEUInt8(static_cast<Byte>((static_cast<Int32>(Decorator.GetType()) << 4) | (Decorator.GetRot() & 0xF))); Pkt.WriteBEUInt8(static_cast<UInt8>(Decorator.GetPixelX())); |