Core/Refactor: Part 2

This commit is contained in:
hondacrx
2018-05-07 22:07:35 -04:00
parent 216db1c23a
commit 9b40067017
93 changed files with 321 additions and 388 deletions
@@ -816,7 +816,7 @@ namespace Game.Entities
if (transmogSlot < 0 || knownPieces[transmogSlot] == 1)
continue;
(var hasAppearance, var isTemporary) = HasItemAppearance(transmogSetItem.ItemModifiedAppearanceID);
(var hasAppearance, bool isTemporary) = HasItemAppearance(transmogSetItem.ItemModifiedAppearanceID);
knownPieces[transmogSlot] = (hasAppearance && !isTemporary) ? 1 : 0;
}
+1 -1
View File
@@ -740,7 +740,7 @@ namespace Game.Entities
{
byte objectiveIndex = result.Read<byte>(1);
var objectiveItr = quest.Objectives.FirstOrDefault(objective => { return objective.StorageIndex == objectiveIndex; });
var objectiveItr = quest.Objectives.FirstOrDefault(objective => objective.StorageIndex == objectiveIndex);
if (objectiveIndex < questStatusData.ObjectiveData.Length && objectiveItr != null)
{
int data = result.Read<int>(2);
+2 -5
View File
@@ -1213,7 +1213,7 @@ namespace Game.Entities
ushort pos = itemPosCount.pos;
uint count = itemPosCount.count;
if (i == dest.Count() - 1)
if (i == dest.Count - 1)
{
lastItem = _StoreItem(pos, pItem, count, false, update);
break;
@@ -4489,10 +4489,7 @@ namespace Game.Entities
public bool HasLootWorldObjectGUID(ObjectGuid lootWorldObjectGuid)
{
return m_AELootView.Any(lootView =>
{
return lootView.Value == lootWorldObjectGuid;
});
return m_AELootView.Any(lootView => lootView.Value == lootWorldObjectGuid);
}
//Inventory
+2 -8
View File
@@ -2778,15 +2778,9 @@ namespace Game.Entities
pctMod.ModifierData.Add(pctData);
}
flatMod.ModifierData.RemoveAll(mod =>
{
return MathFunctions.fuzzyEq(mod.ModifierValue, 0.0f);
});
flatMod.ModifierData.RemoveAll(mod => MathFunctions.fuzzyEq(mod.ModifierValue, 0.0f));
pctMod.ModifierData.RemoveAll(mod =>
{
return MathFunctions.fuzzyEq(mod.ModifierValue, 1.0f);
});
pctMod.ModifierData.RemoveAll(mod => MathFunctions.fuzzyEq(mod.ModifierValue, 1.0f));
flatMods.Modifiers.Add(flatMod);
pctMods.Modifiers.Add(pctMod);
+3 -3
View File
@@ -5284,7 +5284,7 @@ namespace Game.Entities
packet.HealthDelta = 0;
/// @todo find some better solution
packet.PowerDelta[0] = basemana - GetCreateMana();
packet.PowerDelta[0] = (int)basemana - (int)GetCreateMana();
packet.PowerDelta[1] = 0;
packet.PowerDelta[2] = 0;
packet.PowerDelta[3] = 0;
@@ -5292,7 +5292,7 @@ namespace Game.Entities
packet.PowerDelta[5] = 0;
for (Stats i = Stats.Strength; i < Stats.Max; ++i)
packet.StatDelta[(int)i] = info.stats[(int)i] - (uint)GetCreateStat(i);
packet.StatDelta[(int)i] = info.stats[(int)i] - (int)GetCreateStat(i);
uint[] rowLevels = (GetClass() != Class.Deathknight) ? PlayerConst.DefaultTalentRowLevels : PlayerConst.DKTalentRowLevels;
@@ -6301,7 +6301,7 @@ namespace Game.Entities
int count = 0;
string result = System.Text.RegularExpressions.Regex.Replace(input, pattern, m =>
{
return String.Concat("{", count++, "}");
return string.Concat("{", count++, "}");
});
SendSysMessage(result, args);