Merge pull request #2380 from cuberite/travis
Use container-based infrastructure
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user