Replaced X.size() with X.empty(), where applicable.
This commit is contained in:
parent
4c7621ed16
commit
bdd8b43b3e
@ -318,7 +318,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
|
|||||||
// Next Enchantment (Second)
|
// Next Enchantment (Second)
|
||||||
NewEnchantmentLevel = NewEnchantmentLevel / 2;
|
NewEnchantmentLevel = NewEnchantmentLevel / 2;
|
||||||
float SecondEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
|
float SecondEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
|
||||||
if ((Random.NextFloat(100) > SecondEnchantmentChance) || (enchantments.size() == 0))
|
if (enchantments.empty() || (Random.NextFloat(100) > SecondEnchantmentChance))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -333,7 +333,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
|
|||||||
// Next Enchantment (Third)
|
// Next Enchantment (Third)
|
||||||
NewEnchantmentLevel = NewEnchantmentLevel / 2;
|
NewEnchantmentLevel = NewEnchantmentLevel / 2;
|
||||||
float ThirdEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
|
float ThirdEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
|
||||||
if ((Random.NextFloat(100) > ThirdEnchantmentChance) || (enchantments.size() == 0))
|
if (enchantments.empty() || (Random.NextFloat(100) > ThirdEnchantmentChance))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -348,7 +348,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
|
|||||||
// Next Enchantment (Fourth)
|
// Next Enchantment (Fourth)
|
||||||
NewEnchantmentLevel = NewEnchantmentLevel / 2;
|
NewEnchantmentLevel = NewEnchantmentLevel / 2;
|
||||||
float FourthEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
|
float FourthEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
|
||||||
if ((Random.NextFloat(100) > FourthEnchantmentChance) || (enchantments.size() == 0))
|
if (enchantments.empty() || (Random.NextFloat(100) > FourthEnchantmentChance))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user