Fixed some errors from analyzer
This commit is contained in:
@@ -162,8 +162,8 @@ namespace Game.Arenas
|
||||
|
||||
if (winner != 0)
|
||||
{
|
||||
winnerMatchmakerChange = winnerArenaTeam.WonAgainst(winnerMatchmakerRating, loserMatchmakerRating, winnerChange);
|
||||
loserMatchmakerChange = loserArenaTeam.LostAgainst(loserMatchmakerRating, winnerMatchmakerRating, loserChange);
|
||||
winnerMatchmakerChange = winnerArenaTeam.WonAgainst(winnerMatchmakerRating, loserMatchmakerRating, ref winnerChange);
|
||||
loserMatchmakerChange = loserArenaTeam.LostAgainst(loserMatchmakerRating, winnerMatchmakerRating, ref loserChange);
|
||||
|
||||
Log.outDebug(LogFilter.Arena, "match Type: {0} --- Winner: old rating: {1}, rating gain: {2}, old MMR: {3}, MMR gain: {4} --- Loser: old rating: {5}, " +
|
||||
"rating loss: {6}, old MMR: {7}, MMR loss: {8} ---", GetArenaType(), winnerTeamRating, winnerChange, winnerMatchmakerRating, winnerMatchmakerChange,
|
||||
|
||||
@@ -588,7 +588,7 @@ namespace Game.Arenas
|
||||
}
|
||||
}
|
||||
|
||||
public int WonAgainst(uint ownMMRating, uint opponentMMRating, int ratingChange)
|
||||
public int WonAgainst(uint ownMMRating, uint opponentMMRating, ref int ratingChange)
|
||||
{
|
||||
// Called when the team has won
|
||||
// Change in Matchmaker rating
|
||||
@@ -608,7 +608,7 @@ namespace Game.Arenas
|
||||
return mod;
|
||||
}
|
||||
|
||||
public int LostAgainst(uint ownMMRating, uint opponentMMRating, int ratingChange)
|
||||
public int LostAgainst(uint ownMMRating, uint opponentMMRating, ref int ratingChange)
|
||||
{
|
||||
// Called when the team has lost
|
||||
// Change in Matchmaker Rating
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Game.Chat.Commands
|
||||
[Command("god", RBACPermissions.CommandCheatGod)]
|
||||
static bool HandleGodModeCheat(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (handler.GetSession() == null && handler.GetSession().GetPlayer())
|
||||
if (handler.GetSession() == null || handler.GetSession().GetPlayer())
|
||||
return false;
|
||||
|
||||
string argstr = args.NextString();
|
||||
@@ -53,7 +53,7 @@ namespace Game.Chat.Commands
|
||||
[Command("casttime", RBACPermissions.CommandCheatCasttime)]
|
||||
static bool HandleCasttimeCheat(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (handler.GetSession() == null && handler.GetSession().GetPlayer())
|
||||
if (handler.GetSession() == null || handler.GetSession().GetPlayer())
|
||||
return false;
|
||||
|
||||
string argstr = args.NextString();
|
||||
@@ -80,7 +80,7 @@ namespace Game.Chat.Commands
|
||||
[Command("cooldown", RBACPermissions.CommandCheatCooldown)]
|
||||
static bool HandleCoolDownCheat(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (handler.GetSession() == null && handler.GetSession().GetPlayer())
|
||||
if (handler.GetSession() == null || handler.GetSession().GetPlayer())
|
||||
return false;
|
||||
|
||||
string argstr = args.NextString();
|
||||
@@ -107,7 +107,7 @@ namespace Game.Chat.Commands
|
||||
[Command("power", RBACPermissions.CommandCheatPower)]
|
||||
static bool HandlePowerCheat(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (handler.GetSession() == null && handler.GetSession().GetPlayer())
|
||||
if (handler.GetSession() == null || handler.GetSession().GetPlayer())
|
||||
return false;
|
||||
|
||||
string argstr = args.NextString();
|
||||
@@ -152,7 +152,7 @@ namespace Game.Chat.Commands
|
||||
[Command("waterwalk", RBACPermissions.CommandCheatWaterwalk)]
|
||||
static bool HandleWaterWalkCheat(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (handler.GetSession() == null && handler.GetSession().GetPlayer())
|
||||
if (handler.GetSession() == null || handler.GetSession().GetPlayer())
|
||||
return false;
|
||||
|
||||
string argstr = args.NextString();
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace Game.Collision
|
||||
}
|
||||
|
||||
static uint packTileID(uint tileX, uint tileY) { return tileX << 16 | tileY; }
|
||||
static void unpackTileID(uint ID, uint tileX, uint tileY) { tileX = ID >> 16; tileY = ID & 0xFF; }
|
||||
static void unpackTileID(uint ID, ref uint tileX, ref uint tileY) { tileX = ID >> 16; tileY = ID & 0xFF; }
|
||||
public static bool CanLoadMap(string vmapPath, uint mapID, uint tileX, uint tileY)
|
||||
{
|
||||
string fullname = vmapPath + VMapManager.getMapFileName(mapID);
|
||||
|
||||
@@ -612,9 +612,6 @@ namespace Game.DataStorage
|
||||
return 0.0f;
|
||||
|
||||
CurveRecord curve = CliDB.CurveStorage.LookupByKey(curveId);
|
||||
if (points.Empty())
|
||||
return 0.0f;
|
||||
|
||||
switch (DetermineCurveType(curve, points))
|
||||
{
|
||||
case CurveInterpolationMode.Linear:
|
||||
|
||||
@@ -705,7 +705,7 @@ namespace Game.Entities
|
||||
|
||||
public void SetState(ItemUpdateState state, Player forplayer = null)
|
||||
{
|
||||
if (uState == ItemUpdateState.New && uState == ItemUpdateState.Removed)
|
||||
if (uState == ItemUpdateState.New && state == ItemUpdateState.Removed)
|
||||
{
|
||||
// pretend the item never existed
|
||||
if (forplayer)
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace Game.Entities
|
||||
|
||||
float avgDamage = dps * GetDelay() * 0.001f;
|
||||
minDamage = (GetStatScalingFactor() * -0.5f + 1.0f) * avgDamage;
|
||||
maxDamage = (float)Math.Floor((avgDamage * (GetStatScalingFactor() * 0.5f + 1.0f) + 0.5f));
|
||||
maxDamage = (float)Math.Floor(avgDamage * (GetStatScalingFactor() * 0.5f + 1.0f) + 0.5f);
|
||||
}
|
||||
|
||||
public bool IsUsableByLootSpecialization(Player player)
|
||||
|
||||
@@ -164,9 +164,6 @@ namespace Game.Entities
|
||||
if (eventList.Empty())
|
||||
return;
|
||||
|
||||
if (eventList.Empty())
|
||||
return;
|
||||
|
||||
foreach (uint questId in eventList)
|
||||
{
|
||||
uint questBit = Global.DB2Mgr.GetQuestUniqueBitFlag(questId);
|
||||
|
||||
@@ -1836,7 +1836,7 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsTriggeredAtSpellProcEvent(target, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, active, triggerData.spellProcEvent))
|
||||
if (!IsTriggeredAtSpellProcEvent(target, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, active, ref triggerData.spellProcEvent))
|
||||
continue;
|
||||
|
||||
// do checks using conditions table
|
||||
@@ -2415,7 +2415,7 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
bool IsTriggeredAtSpellProcEvent(Unit victim, Aura aura, SpellInfo procSpell, ProcFlags procFlag, ProcFlagsExLegacy procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry spellProcEvent)
|
||||
bool IsTriggeredAtSpellProcEvent(Unit victim, Aura aura, SpellInfo procSpell, ProcFlags procFlag, ProcFlagsExLegacy procExtra, WeaponAttackType attType, bool isVictim, bool active, ref SpellProcEventEntry spellProcEvent)
|
||||
{
|
||||
SpellInfo spellInfo = aura.GetSpellInfo();
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace Game.Garrisons
|
||||
}
|
||||
|
||||
List<GarrAbilityRecord> genericTraits = genericTraitsTemp.Except(forcedTraits).ToList();
|
||||
genericTraits.AddRange(genericTraits);
|
||||
genericTraits.AddRange(traitList);
|
||||
genericTraits.Sort((GarrAbilityRecord a1, GarrAbilityRecord a2) =>
|
||||
{
|
||||
int e1 = (int)(a1.Flags & GarrisonAbilityFlags.Exclusive);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Game.Garrisons
|
||||
|
||||
public override void LoadGridObjects(Grid grid, Cell cell)
|
||||
{
|
||||
LoadGridObjects(grid, cell);
|
||||
base.LoadGridObjects(grid, cell);
|
||||
|
||||
GarrisonGridLoader loader = new GarrisonGridLoader(grid, this, cell);
|
||||
loader.LoadN();
|
||||
|
||||
+3
-3
@@ -184,7 +184,7 @@ namespace Game.Loots
|
||||
if (_difficultyBonusTreeMod != 0)
|
||||
{
|
||||
List<uint> bonusListIDs = Global.DB2Mgr.GetItemBonusTree(generatedLoot.itemid, _difficultyBonusTreeMod);
|
||||
generatedLoot.BonusListIDs.AddRange(generatedLoot.BonusListIDs);
|
||||
generatedLoot.BonusListIDs.AddRange(bonusListIDs);
|
||||
}
|
||||
lootItems.Add(generatedLoot);
|
||||
count -= proto.GetMaxStackSize();
|
||||
@@ -767,7 +767,7 @@ namespace Game.Loots
|
||||
if (!fi.is_looted && !item.is_looted)
|
||||
{
|
||||
LootItemData lootItem = new LootItemData();
|
||||
lootItem.LootListID = (byte)(items.Count + fi.index + 1);
|
||||
lootItem.LootListID = (byte)(fi.index + 1);
|
||||
lootItem.UIType = slotType;
|
||||
lootItem.Quantity = item.count;
|
||||
lootItem.Loot = new ItemInstance(item);
|
||||
@@ -786,7 +786,7 @@ namespace Game.Loots
|
||||
if (!ci.is_looted && !item.is_looted)
|
||||
{
|
||||
LootItemData lootItem = new LootItemData();
|
||||
lootItem.LootListID = (byte)(items.Count + ci.index + 1);
|
||||
lootItem.LootListID = (byte)(ci.index + 1);
|
||||
lootItem.Quantity = item.count;
|
||||
lootItem.Loot = new ItemInstance(item);
|
||||
|
||||
|
||||
+1
-1
@@ -302,7 +302,7 @@ namespace Game.Maps
|
||||
high_bound = high;
|
||||
}
|
||||
|
||||
void ResizeBorders(ICoord begin_cell, ICoord end_cell)
|
||||
void ResizeBorders(ref ICoord begin_cell, ref ICoord end_cell)
|
||||
{
|
||||
begin_cell = low_bound;
|
||||
end_cell = high_bound;
|
||||
|
||||
+1
-1
@@ -3792,7 +3792,7 @@ namespace Game.Maps
|
||||
if (unit)
|
||||
{
|
||||
// Target must be GameObject.
|
||||
if (target != null)
|
||||
if (target == null)
|
||||
{
|
||||
Log.outError(LogFilter.Scripts, "{0} target object is NULL.", step.script.GetDebugInfo());
|
||||
break;
|
||||
|
||||
@@ -4930,7 +4930,7 @@ namespace Game.Spells
|
||||
int skillValue = 0;
|
||||
|
||||
// check lock compatibility
|
||||
SpellCastResult res = CanOpenLock(effect.EffectIndex, lockId, skillId, ref reqSkillValue, ref skillValue);
|
||||
SpellCastResult res = CanOpenLock(effect.EffectIndex, lockId, ref skillId, ref reqSkillValue, ref skillValue);
|
||||
if (res != SpellCastResult.SpellCastOk)
|
||||
return res;
|
||||
break;
|
||||
@@ -6541,7 +6541,7 @@ namespace Game.Spells
|
||||
modOwner.SetSpellModTakingSpell(this, false);
|
||||
}
|
||||
|
||||
SpellCastResult CanOpenLock(uint effIndex, uint lockId, SkillType skillId, ref int reqSkillValue, ref int skillValue)
|
||||
SpellCastResult CanOpenLock(uint effIndex, uint lockId, ref SkillType skillId, ref int reqSkillValue, ref int skillValue)
|
||||
{
|
||||
if (lockId == 0) // possible case for GO and maybe for items.
|
||||
return SpellCastResult.SpellCastOk;
|
||||
|
||||
@@ -1579,7 +1579,7 @@ namespace Game.Spells
|
||||
int reqSkillValue = 0;
|
||||
int skillValue = 0;
|
||||
|
||||
SpellCastResult res = CanOpenLock(effIndex, lockId, skillId, ref reqSkillValue, ref skillValue);
|
||||
SpellCastResult res = CanOpenLock(effIndex, lockId, ref skillId, ref reqSkillValue, ref skillValue);
|
||||
if (res != SpellCastResult.SpellCastOk)
|
||||
{
|
||||
SendCastResult(res);
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Game.Spells
|
||||
_visuals = visuals;
|
||||
// sort all visuals so that the ones without a condition requirement are last on the list
|
||||
foreach (var key in _visuals.Keys)
|
||||
_visuals[key].OrderByDescending(x => x.PlayerConditionID);
|
||||
_visuals[key] = _visuals[key].OrderByDescending(x => x.PlayerConditionID).ToList();
|
||||
|
||||
// SpellScalingEntry
|
||||
SpellScalingRecord _scaling = data.Scaling;
|
||||
|
||||
Reference in New Issue
Block a user