More Cleanups

This commit is contained in:
hondacrx
2021-06-08 12:56:09 -04:00
parent 302a1f293c
commit 52e43853fe
58 changed files with 223 additions and 257 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ namespace Game.Entities
}
else
{
Log.outError(LogFilter.Player, $"Player._LoadInventory: Player '{GetName()}' ({GetGUID().ToString()}) has child item ({item.GetGUID()}, entry: {item.GetEntry()}) which can't be loaded into inventory because parent item was not found (Bag {bagGuid}, slot: {slot}). Item will be sent by mail.");
Log.outError(LogFilter.Player, $"Player._LoadInventory: Player '{GetName()}' ({GetGUID()}) has child item ({item.GetGUID()}, entry: {item.GetEntry()}) which can't be loaded into inventory because parent item was not found (Bag {bagGuid}, slot: {slot}). Item will be sent by mail.");
item.DeleteFromInventoryDB(trans);
problematicItems.Enqueue(item);
continue;
@@ -1891,7 +1891,7 @@ namespace Game.Entities
void _SaveActions(SQLTransaction trans)
{
PreparedStatement stmt = null;
PreparedStatement stmt;
foreach (var pair in m_actionButtons.ToList())
{
+1 -2
View File
@@ -495,8 +495,7 @@ namespace Game.Entities
}
InventoryResult CanStoreItem(byte bag, byte slot, List<ItemPosCount> dest, uint entry, uint count, Item pItem, bool swap)
{
uint throwaway;
return CanStoreItem(bag, slot, dest, entry, count, pItem, swap, out throwaway);
return CanStoreItem(bag, slot, dest, entry, count, pItem, swap, out _);
}
InventoryResult CanStoreItem(byte bag, byte slot, List<ItemPosCount> dest, uint entry, uint count, Item pItem, bool swap, out uint no_space_count)
{
+5 -5
View File
@@ -1413,13 +1413,13 @@ namespace Game.Entities
switch (Condition.Operator[i])
{
case 2: // requires less <color> than (<value> || <comparecolor>) gems
activate &= (_cur_gem < _cmp_gem) ? true : false;
activate &= (_cur_gem < _cmp_gem);
break;
case 3: // requires more <color> than (<value> || <comparecolor>) gems
activate &= (_cur_gem > _cmp_gem) ? true : false;
activate &= (_cur_gem > _cmp_gem);
break;
case 5: // requires at least <color> than (<value> || <comparecolor>) gems
activate &= (_cur_gem >= _cmp_gem) ? true : false;
activate &= (_cur_gem >= _cmp_gem);
break;
}
}
@@ -2039,7 +2039,7 @@ namespace Game.Entities
{
PlayerSpell spell = m_spells.LookupByKey(spellId);
bool disabled = (spell != null) ? spell.Disabled : false;
bool disabled = (spell != null) && spell.Disabled;
bool active = !disabled || spell.Active;
bool learning = AddSpell(spellId, active, true, dependent, false, false, fromSkill);
@@ -2989,7 +2989,7 @@ namespace Game.Entities
public void SetRuneCooldown(byte index, uint cooldown)
{
m_runes.Cooldown[index] = cooldown;
m_runes.SetRuneState(index, (cooldown == 0) ? true : false);
m_runes.SetRuneState(index, (cooldown == 0));
int activeRunes = m_runes.Cooldown.Count(p => p == 0);
if (activeRunes != GetPower(PowerType.Runes))
SetPower(PowerType.Runes, activeRunes);
+2 -4
View File
@@ -155,9 +155,8 @@ namespace Game.Entities
for (int i = 1; i < m_TaxiDestinations.Count; ++i)
{
uint cost;
uint path;
Global.ObjectMgr.GetTaxiPath(m_TaxiDestinations[i - 1], m_TaxiDestinations[i], out path, out cost);
Global.ObjectMgr.GetTaxiPath(m_TaxiDestinations[i - 1], m_TaxiDestinations[i], out path, out _);
if (path == 0)
return false;
}
@@ -189,9 +188,8 @@ namespace Game.Entities
return 0;
uint path;
uint cost;
Global.ObjectMgr.GetTaxiPath(m_TaxiDestinations[0], m_TaxiDestinations[1], out path, out cost);
Global.ObjectMgr.GetTaxiPath(m_TaxiDestinations[0], m_TaxiDestinations[1], out path, out _);
return path;
}