Misc cleanups
This commit is contained in:
@@ -1429,7 +1429,7 @@ namespace Game.Entities
|
||||
var guid = ChairListSlots.LookupByKey(nearest_slot);
|
||||
if (!guid.IsEmpty())
|
||||
{
|
||||
guid = player.GetGUID(); //this slot in now used by player
|
||||
ChairListSlots[nearest_slot] = player.GetGUID(); //this slot in now used by player
|
||||
player.TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(), (TeleportToOptions.NotLeaveTransport | TeleportToOptions.NotLeaveCombat | TeleportToOptions.NotUnSummonPet));
|
||||
player.SetStandState(UnitStandStateType.SitLowChair + (byte)info.Chair.chairheight);
|
||||
return;
|
||||
|
||||
@@ -1601,7 +1601,7 @@ namespace Game.Entities
|
||||
return 0;
|
||||
|
||||
float qualityFactor = qualityPrice.Data;
|
||||
float baseFactor = 0.0f;
|
||||
float baseFactor;
|
||||
|
||||
var inventoryType = proto.GetInventoryType();
|
||||
|
||||
@@ -2308,11 +2308,6 @@ namespace Game.Entities
|
||||
break;
|
||||
case ItemEnchantmentType.ArtifactPowerBonusRankByID:
|
||||
{
|
||||
var indexItr = m_artifactPowerIdToIndex.LookupByKey(enchant.EffectArg[i]);
|
||||
ushort index;
|
||||
if (indexItr != 0)
|
||||
index = indexItr;
|
||||
|
||||
ushort artifactPowerIndex = m_artifactPowerIdToIndex.LookupByKey(enchant.EffectArg[i]);
|
||||
if (artifactPowerIndex != 0)
|
||||
{
|
||||
@@ -2933,7 +2928,7 @@ namespace Game.Entities
|
||||
break;
|
||||
case ItemBonusType.Stat:
|
||||
{
|
||||
uint statIndex = 0;
|
||||
uint statIndex;
|
||||
for (statIndex = 0; statIndex < ItemConst.MaxStats; ++statIndex)
|
||||
if (ItemStatType[statIndex] == values[0] || ItemStatType[statIndex] == -1)
|
||||
break;
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Game.Entities
|
||||
|
||||
ulong ownerid = owner.GetGUID().GetCounter();
|
||||
|
||||
PreparedStatement stmt = null;
|
||||
PreparedStatement stmt;
|
||||
|
||||
if (petnumber != 0)
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Game.Entities
|
||||
|
||||
public void SaveAccountToys(SQLTransaction trans)
|
||||
{
|
||||
PreparedStatement stmt = null;
|
||||
PreparedStatement stmt;
|
||||
foreach (var pair in _toys)
|
||||
{
|
||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_ACCOUNT_TOYS);
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace Game.Entities
|
||||
item = Bag.NewItemOrBag(proto);
|
||||
if (item.LoadFromDB(itemGuid, GetGUID(), fields, itemEntry))
|
||||
{
|
||||
PreparedStatement stmt = null;
|
||||
PreparedStatement stmt;
|
||||
|
||||
// Do not allow to have item limited to another map/zone in alive state
|
||||
if (IsAlive() && item.IsLimitedToAnotherMapOrZone(GetMapId(), zoneId))
|
||||
@@ -349,7 +349,7 @@ namespace Game.Entities
|
||||
{
|
||||
if (mSkillStatus.Count >= SkillConst.MaxPlayerSkills) // client limit
|
||||
{
|
||||
Log.outError(LogFilter.Player, $"Player::_LoadSkills: Player '{GetName()}' ({GetGUID().ToString()}) has more than {SkillConst.MaxPlayerSkills} skills.");
|
||||
Log.outError(LogFilter.Player, $"Player::_LoadSkills: Player '{GetName()}' ({GetGUID()}) has more than {SkillConst.MaxPlayerSkills} skills.");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1235,7 +1235,7 @@ namespace Game.Entities
|
||||
ItemTemplate proto = Global.ObjectMgr.GetItemTemplate(itemEntry);
|
||||
if (proto == null)
|
||||
{
|
||||
Log.outError(LogFilter.Player, $"Player {(player != null ? player.GetName() : "<unknown>")} ({playerGuid.ToString()}) has unknown item in mailed items (GUID: {itemGuid} template: {itemEntry}) in mail ({mailId}), deleted.");
|
||||
Log.outError(LogFilter.Player, $"Player {(player != null ? player.GetName() : "<unknown>")} ({playerGuid}) has unknown item in mailed items (GUID: {itemGuid} template: {itemEntry}) in mail ({mailId}), deleted.");
|
||||
|
||||
SQLTransaction trans = new SQLTransaction();
|
||||
|
||||
@@ -1657,7 +1657,7 @@ namespace Game.Entities
|
||||
}
|
||||
void _SaveSpells(SQLTransaction trans)
|
||||
{
|
||||
PreparedStatement stmt = null;
|
||||
PreparedStatement stmt;
|
||||
|
||||
foreach (var spell in m_spells.ToList())
|
||||
{
|
||||
@@ -1767,7 +1767,7 @@ namespace Game.Entities
|
||||
}
|
||||
void _SaveCurrency(SQLTransaction trans)
|
||||
{
|
||||
PreparedStatement stmt = null;
|
||||
PreparedStatement stmt;
|
||||
foreach (var pair in _currencyStorage)
|
||||
{
|
||||
CurrencyTypesRecord entry = CliDB.CurrencyTypesStorage.LookupByKey(pair.Key);
|
||||
@@ -2180,7 +2180,7 @@ namespace Game.Entities
|
||||
foreach (var pair in _equipmentSets)
|
||||
{
|
||||
EquipmentSetInfo eqSet = pair.Value;
|
||||
PreparedStatement stmt = null;
|
||||
PreparedStatement stmt;
|
||||
byte j = 0;
|
||||
switch (eqSet.state)
|
||||
{
|
||||
@@ -2271,7 +2271,7 @@ namespace Game.Entities
|
||||
}
|
||||
void _SaveVoidStorage(SQLTransaction trans)
|
||||
{
|
||||
PreparedStatement stmt = null;
|
||||
PreparedStatement stmt;
|
||||
for (byte i = 0; i < SharedConst.VoidStorageMaxSlot; ++i)
|
||||
{
|
||||
if (_voidStorageItems[i] == null) // unused item
|
||||
@@ -2307,7 +2307,7 @@ namespace Game.Entities
|
||||
}
|
||||
void _SaveCUFProfiles(SQLTransaction trans)
|
||||
{
|
||||
PreparedStatement stmt = null;
|
||||
PreparedStatement stmt;
|
||||
ulong lowGuid = GetGUID().GetCounter();
|
||||
|
||||
for (byte i = 0; i < PlayerConst.MaxCUFProfiles; ++i)
|
||||
@@ -3144,7 +3144,7 @@ namespace Game.Entities
|
||||
stmt.AddValue(0, GetGUID().GetCounter());
|
||||
characterTransaction.Append(stmt);
|
||||
|
||||
float finiteAlways(float f) { return !float.IsInfinity(f) ? f : 0.0f; };
|
||||
static float finiteAlways(float f) { return !float.IsInfinity(f) ? f : 0.0f; };
|
||||
|
||||
if (create)
|
||||
{
|
||||
|
||||
@@ -593,14 +593,14 @@ namespace Game.Entities
|
||||
PvpTalentRecord talentInfo = CliDB.PvpTalentStorage.LookupByKey(pvpTalents[slot]);
|
||||
if (talentInfo == null)
|
||||
{
|
||||
Log.outError(LogFilter.Player, $"Player.SendTalentsInfoData: Player '{GetName()}' ({GetGUID().ToString()}) has unknown pvp talent id: {pvpTalents[slot]}");
|
||||
Log.outError(LogFilter.Player, $"Player.SendTalentsInfoData: Player '{GetName()}' ({GetGUID()}) has unknown pvp talent id: {pvpTalents[slot]}");
|
||||
continue;
|
||||
}
|
||||
|
||||
SpellInfo spellEntry = Global.SpellMgr.GetSpellInfo(talentInfo.SpellID);
|
||||
if (spellEntry == null)
|
||||
{
|
||||
Log.outError(LogFilter.Player, $"Player.SendTalentsInfoData: Player '{GetName()}' ({GetGUID().ToString()}) has unknown pvp talent spell: {talentInfo.SpellID}");
|
||||
Log.outError(LogFilter.Player, $"Player.SendTalentsInfoData: Player '{GetName()}' ({GetGUID()}) has unknown pvp talent spell: {talentInfo.SpellID}");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user