Some cleanups. (might break build for scripts as they are a WIP)

This commit is contained in:
hondacrx
2023-10-08 10:35:31 -04:00
parent fa10b981bd
commit cda53c8e7f
208 changed files with 2266 additions and 2329 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ namespace Game.Combat
Player playerA = a.GetCharmerOrOwnerPlayerOrPlayerItself();
Player playerB = b.GetCharmerOrOwnerPlayerOrPlayerItself();
// ...neither of the two units must be (owned by) a player with .gm on
if ((playerA && playerA.IsGameMaster()) || (playerB && playerB.IsGameMaster()))
if ((playerA != null && playerA.IsGameMaster()) || (playerB != null && playerB.IsGameMaster()))
return false;
return true;
}
+3 -3
View File
@@ -38,7 +38,7 @@ namespace Game.Combat
{
Creature cWho = who.ToCreature();
// only creatures can have threat list
if (!cWho)
if (cWho == null)
return false;
// pets, totems and triggers cannot have threat list
@@ -263,7 +263,7 @@ namespace Game.Combat
else
redirTarget = Global.ObjAccessor.GetUnit(_owner, pair.Item1);
if (redirTarget)
if (redirTarget != null)
{
float amountRedirected = MathFunctions.CalculatePct(origAmount, pair.Item2);
AddThreat(redirTarget, amountRedirected, spell, true, true);
@@ -397,7 +397,7 @@ namespace Game.Combat
public void FixateTarget(Unit target)
{
if (target)
if (target != null)
{
var it = _myThreatListEntries.LookupByKey(target.GetGUID());
if (it != null)