Some cleanups. (might break build for scripts as they are a WIP)
This commit is contained in:
@@ -68,7 +68,7 @@ namespace Game.Entities
|
||||
|
||||
player.GetMap().LoadGridForActiveObject(pos.GetPositionX(), pos.GetPositionY(), player);
|
||||
m_CinematicObject = player.SummonCreature(1, pos.posX, pos.posY, pos.posZ, 0.0f, TempSummonType.TimedDespawn, TimeSpan.FromMinutes(5));
|
||||
if (m_CinematicObject)
|
||||
if (m_CinematicObject != null)
|
||||
{
|
||||
m_CinematicObject.SetActive(true);
|
||||
player.SetViewpoint(m_CinematicObject, true);
|
||||
@@ -89,10 +89,10 @@ namespace Game.Entities
|
||||
m_cinematicCamera = null;
|
||||
m_activeCinematic = null;
|
||||
m_activeCinematicCameraIndex = -1;
|
||||
if (m_CinematicObject)
|
||||
if (m_CinematicObject != null)
|
||||
{
|
||||
WorldObject vpObject = player.GetViewpoint();
|
||||
if (vpObject)
|
||||
if (vpObject != null)
|
||||
if (vpObject == m_CinematicObject)
|
||||
player.SetViewpoint(m_CinematicObject, false);
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace Game.Entities
|
||||
|
||||
// Advance (at speed) to this position. The remote sight object is used
|
||||
// to send update information to player in cinematic
|
||||
if (m_CinematicObject && interPosition.IsPositionValid())
|
||||
if (m_CinematicObject != null && interPosition.IsPositionValid())
|
||||
m_CinematicObject.MonsterMoveWithSpeed(interPosition.posX, interPosition.posY, interPosition.posZ, 500.0f, false, true);
|
||||
|
||||
// If we never received an end packet 10 seconds after the final timestamp then force an end
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace Game.Entities
|
||||
public void UpgradeHeirloom(uint itemId, uint castItem)
|
||||
{
|
||||
Player player = _owner.GetPlayer();
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
HeirloomRecord heirloom = Global.DB2Mgr.GetHeirloomByItemId(itemId);
|
||||
@@ -275,7 +275,7 @@ namespace Game.Entities
|
||||
public void CheckHeirloomUpgrades(Item item)
|
||||
{
|
||||
Player player = _owner.GetPlayer();
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
// Check already owned heirloom for upgrade kits
|
||||
@@ -292,7 +292,7 @@ namespace Game.Entities
|
||||
HeirloomRecord heirloomDiff;
|
||||
while ((heirloomDiff = Global.DB2Mgr.GetHeirloomByItemId(heirloomItemId)) != null)
|
||||
{
|
||||
if (player.GetItemByEntry(heirloomDiff.ItemID))
|
||||
if (player.GetItemByEntry(heirloomDiff.ItemID) != null)
|
||||
newItemId = heirloomDiff.ItemID;
|
||||
|
||||
HeirloomRecord heirloomSub = Global.DB2Mgr.GetHeirloomByItemId(heirloomDiff.StaticUpgradedItemID);
|
||||
@@ -372,7 +372,7 @@ namespace Game.Entities
|
||||
public bool AddMount(uint spellId, MountStatusFlags flags, bool factionMount = false, bool learned = false)
|
||||
{
|
||||
Player player = _owner.GetPlayer();
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return false;
|
||||
|
||||
MountRecord mount = Global.DB2Mgr.GetMount(spellId);
|
||||
@@ -420,7 +420,7 @@ namespace Game.Entities
|
||||
void SendSingleMountUpdate(uint spellId, MountStatusFlags mountStatusFlags)
|
||||
{
|
||||
Player player = _owner.GetPlayer();
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
AccountMountUpdate mountUpdate = new();
|
||||
@@ -592,7 +592,7 @@ namespace Game.Entities
|
||||
if (itemTemplate == null)
|
||||
return false;
|
||||
|
||||
if (!_owner.GetPlayer())
|
||||
if (_owner.GetPlayer() == null)
|
||||
return false;
|
||||
|
||||
if (_owner.GetPlayer().CanUseItem(itemTemplate) != InventoryResult.Ok)
|
||||
|
||||
@@ -129,14 +129,14 @@ namespace Game.Entities
|
||||
// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance,
|
||||
// for whom victim is not gray;
|
||||
uint grayLevel = Formulas.GetGrayLevel(lvl);
|
||||
if (_victim.GetLevelForTarget(member) > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember.GetLevel() < lvl))
|
||||
if (_victim.GetLevelForTarget(member) > grayLevel && (_maxNotGrayMember == null || _maxNotGrayMember.GetLevel() < lvl))
|
||||
_maxNotGrayMember = member;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 2.5. _isFullXP - flag identifying that for all group members victim is not gray,
|
||||
// so 100% XP will be rewarded (50% otherwise).
|
||||
_isFullXP = _maxNotGrayMember && (_maxLevel == _maxNotGrayMember.GetLevel());
|
||||
_isFullXP = _maxNotGrayMember != null && (_maxLevel == _maxNotGrayMember.GetLevel());
|
||||
}
|
||||
else
|
||||
_count = 1;
|
||||
@@ -185,7 +185,7 @@ namespace Game.Entities
|
||||
// 4.2.3. Give XP to player.
|
||||
player.GiveXP(xp, _victim, _groupRate);
|
||||
Pet pet = player.GetPet();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
// 4.2.4. If player has pet, reward pet with XP (100% for single player, 50% for group case).
|
||||
pet.GivePetXP(player.GetGroup() != null ? xp / 2 : xp);
|
||||
}
|
||||
@@ -264,7 +264,7 @@ namespace Game.Entities
|
||||
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next())
|
||||
{
|
||||
Player member = refe.GetSource();
|
||||
if (member)
|
||||
if (member != null)
|
||||
{
|
||||
// Killer may not be at reward distance, check directly
|
||||
if (killer == member || member.IsAtGroupRewardDistance(_victim))
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Game.Entities
|
||||
scenario.UpdateCriteria(type, miscValue1, miscValue2, miscValue3, refe, this);
|
||||
|
||||
Guild guild = Global.GuildMgr.GetGuildById(GetGuildId());
|
||||
if (guild)
|
||||
if (guild != null)
|
||||
guild.UpdateCriteria(type, miscValue1, miscValue2, miscValue3, refe, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,19 +38,19 @@ namespace Game.Entities
|
||||
|
||||
// prepare data for near group iteration
|
||||
Group group = GetGroup();
|
||||
if (group)
|
||||
if (group != null)
|
||||
{
|
||||
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next())
|
||||
{
|
||||
Player player = refe.GetSource();
|
||||
if (!player)
|
||||
if (player == null)
|
||||
continue;
|
||||
|
||||
if (!player.IsAtGroupRewardDistance(pRewardSource))
|
||||
continue; // member (alive or dead) or his corpse at req. distance
|
||||
|
||||
// quest objectives updated only for alive group member or dead but with not released body
|
||||
if (player.IsAlive() || !player.GetCorpse())
|
||||
if (player.IsAlive() || player.GetCorpse() == null)
|
||||
player.KilledMonsterCredit(creature_id, creature_guid);
|
||||
}
|
||||
}
|
||||
@@ -247,7 +247,7 @@ namespace Game.Entities
|
||||
bool IsTwoHandUsed()
|
||||
{
|
||||
Item mainItem = GetItemByPos(InventorySlots.Bag0, EquipmentSlot.MainHand);
|
||||
if (!mainItem)
|
||||
if (mainItem == null)
|
||||
return false;
|
||||
|
||||
ItemTemplate itemTemplate = mainItem.GetTemplate();
|
||||
@@ -259,14 +259,14 @@ namespace Game.Entities
|
||||
bool IsUsingTwoHandedWeaponInOneHand()
|
||||
{
|
||||
Item offItem = GetItemByPos(InventorySlots.Bag0, EquipmentSlot.OffHand);
|
||||
if (offItem && offItem.GetTemplate().GetInventoryType() == InventoryType.Weapon2Hand)
|
||||
if (offItem != null && offItem.GetTemplate().GetInventoryType() == InventoryType.Weapon2Hand)
|
||||
return true;
|
||||
|
||||
Item mainItem = GetItemByPos(InventorySlots.Bag0, EquipmentSlot.MainHand);
|
||||
if (!mainItem || mainItem.GetTemplate().GetInventoryType() == InventoryType.Weapon2Hand)
|
||||
if (mainItem == null || mainItem.GetTemplate().GetInventoryType() == InventoryType.Weapon2Hand)
|
||||
return false;
|
||||
|
||||
if (!offItem)
|
||||
if (offItem == null)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -390,7 +390,7 @@ namespace Game.Entities
|
||||
|
||||
ObjectGuid duelFlagGUID = m_playerData.DuelArbiter;
|
||||
GameObject obj = GetMap().GetGameObject(duelFlagGUID);
|
||||
if (!obj)
|
||||
if (obj == null)
|
||||
return;
|
||||
|
||||
if (duel.OutOfBoundsTime == 0)
|
||||
@@ -494,7 +494,7 @@ namespace Game.Entities
|
||||
|
||||
//Remove Duel Flag object
|
||||
GameObject obj = GetMap().GetGameObject(m_playerData.DuelArbiter);
|
||||
if (obj)
|
||||
if (obj != null)
|
||||
duel.Initiator.RemoveGameObject(obj, true);
|
||||
|
||||
//remove auras
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Game.Entities
|
||||
if (item.HasItemFlag(ItemFieldFlags.Child))
|
||||
{
|
||||
Item parent = GetItemByGuid(item.GetCreator());
|
||||
if (parent)
|
||||
if (parent != null)
|
||||
{
|
||||
parent.SetChildItem(item.GetGUID());
|
||||
item.CopyArtifactDataFromParent(parent);
|
||||
@@ -1468,7 +1468,7 @@ namespace Game.Entities
|
||||
if (!result.IsEmpty())
|
||||
{
|
||||
Group group = Global.GroupMgr.GetGroupByDbStoreId(result.Read<uint>(0));
|
||||
if (group)
|
||||
if (group != null)
|
||||
{
|
||||
if (group.IsLeader(GetGUID()))
|
||||
SetPlayerFlag(PlayerFlags.GroupLeader);
|
||||
@@ -1485,7 +1485,7 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (!GetGroup() || !GetGroup().IsLeader(GetGUID()))
|
||||
if (GetGroup() == null || !GetGroup().IsLeader(GetGUID()))
|
||||
RemovePlayerFlag(PlayerFlags.GroupLeader);
|
||||
}
|
||||
void _LoadInstanceTimeRestrictions(SQLResult result)
|
||||
@@ -1777,7 +1777,7 @@ namespace Game.Entities
|
||||
case ItemUpdateState.Changed:
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CharStatements.REP_INVENTORY_ITEM);
|
||||
stmt.AddValue(0, GetGUID().GetCounter());
|
||||
stmt.AddValue(1, container ? container.GetGUID().GetCounter() : 0);
|
||||
stmt.AddValue(1, container != null ? container.GetGUID().GetCounter() : 0);
|
||||
stmt.AddValue(2, item.GetSlot());
|
||||
stmt.AddValue(3, item.GetGUID().GetCounter());
|
||||
trans.Append(stmt);
|
||||
@@ -3090,7 +3090,7 @@ namespace Game.Entities
|
||||
mapId = transportOnMap.GetExpectedMapId();
|
||||
instanceId = 0;
|
||||
transportMap = Global.MapMgr.CreateMap(mapId, this);
|
||||
if (transportMap)
|
||||
if (transportMap != null)
|
||||
transport = transportMap.GetTransport(transGUID);
|
||||
}
|
||||
else
|
||||
@@ -3098,7 +3098,7 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (transport)
|
||||
if (transport != null)
|
||||
{
|
||||
float x = trans_x;
|
||||
float y = trans_y;
|
||||
@@ -3201,13 +3201,13 @@ namespace Game.Entities
|
||||
|
||||
// NOW player must have valid map
|
||||
// load the player's map here if it's not already loaded
|
||||
if (!map)
|
||||
if (map == null)
|
||||
map = Global.MapMgr.CreateMap(mapId, this);
|
||||
|
||||
AreaTriggerStruct areaTrigger = null;
|
||||
bool check = false;
|
||||
|
||||
if (!map)
|
||||
if (map == null)
|
||||
{
|
||||
areaTrigger = Global.ObjectMgr.GetGoBackTrigger(mapId);
|
||||
check = true;
|
||||
@@ -3241,11 +3241,11 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (!map)
|
||||
if (map == null)
|
||||
{
|
||||
RelocateToHomebind();
|
||||
map = Global.MapMgr.CreateMap(mapId, this);
|
||||
if (!map)
|
||||
if (map == null)
|
||||
{
|
||||
Log.outError(LogFilter.Player, "Player {0} {1} Map: {2}, {3}. Invalid default map coordinates or instance couldn't be created.", GetName(), guid.ToString(), mapId, GetPosition());
|
||||
return false;
|
||||
@@ -3960,7 +3960,7 @@ namespace Game.Entities
|
||||
|
||||
// save pet (hunter pet level and experience and all type pets health/mana).
|
||||
Pet pet = GetPet();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
pet.SavePetToDB(PetSaveMode.AsCurrent);
|
||||
}
|
||||
void DeleteSpellFromAllPlayers(uint spellId)
|
||||
@@ -4060,7 +4060,7 @@ namespace Game.Entities
|
||||
if (guildId != 0)
|
||||
{
|
||||
Guild guild = Global.GuildMgr.GetGuildById(guildId);
|
||||
if (guild)
|
||||
if (guild != null)
|
||||
guild.DeleteMember(trans, playerGuid, false, false, true);
|
||||
}
|
||||
|
||||
@@ -4075,7 +4075,7 @@ namespace Game.Entities
|
||||
if (!resultGroup.IsEmpty())
|
||||
{
|
||||
Group group = Global.GroupMgr.GetGroupByDbStoreId(resultGroup.Read<uint>(0));
|
||||
if (group)
|
||||
if (group != null)
|
||||
RemoveFromGroup(group, playerGuid);
|
||||
}
|
||||
|
||||
@@ -4215,7 +4215,7 @@ namespace Game.Entities
|
||||
do
|
||||
{
|
||||
Player playerFriend = Global.ObjAccessor.FindPlayer(ObjectGuid.Create(HighGuid.Player, resultFriends.Read<ulong>(0)));
|
||||
if (playerFriend)
|
||||
if (playerFriend != null)
|
||||
{
|
||||
playerFriend.GetSocial().RemoveFromSocialList(playerGuid, SocialFlag.All);
|
||||
Global.SocialMgr.SendFriendStatus(playerFriend, FriendsResult.Removed, playerGuid);
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Game.Entities
|
||||
Player GetNextRandomRaidMember(float radius)
|
||||
{
|
||||
Group group = GetGroup();
|
||||
if (!group)
|
||||
if (group == null)
|
||||
return null;
|
||||
|
||||
List<Player> nearMembers = new();
|
||||
@@ -23,7 +23,7 @@ namespace Game.Entities
|
||||
Player Target = refe.GetSource();
|
||||
|
||||
// IsHostileTo check duel and controlled by enemy
|
||||
if (Target && Target != this && IsWithinDistInMap(Target, radius) &&
|
||||
if (Target != null && Target != this && IsWithinDistInMap(Target, radius) &&
|
||||
!Target.HasInvisibilityAura() && !IsHostileTo(Target))
|
||||
nearMembers.Add(Target);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ namespace Game.Entities
|
||||
public PartyResult CanUninviteFromGroup(ObjectGuid guidMember, byte? partyIndex)
|
||||
{
|
||||
Group grp = GetGroup(partyIndex);
|
||||
if (!grp)
|
||||
if (grp == null)
|
||||
return PartyResult.NotInGroup;
|
||||
|
||||
if (grp.IsLFGGroup())
|
||||
@@ -63,7 +63,7 @@ namespace Game.Entities
|
||||
|
||||
// @todo Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer.
|
||||
for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.Next())
|
||||
if (refe.GetSource() && refe.GetSource().IsInMap(this) && refe.GetSource().IsInCombat())
|
||||
if (refe.GetSource() != null && refe.GetSource().IsInMap(this) && refe.GetSource().IsInCombat())
|
||||
return PartyResult.PartyLfgBootInCombat;
|
||||
|
||||
/* Missing support for these types
|
||||
@@ -117,7 +117,7 @@ namespace Game.Entities
|
||||
//remove existing reference
|
||||
m_group.Unlink();
|
||||
Group group = GetOriginalGroup();
|
||||
if (group)
|
||||
if (group != null)
|
||||
{
|
||||
m_group.Link(group, this);
|
||||
m_group.SetSubGroup(GetOriginalSubGroup());
|
||||
@@ -127,7 +127,7 @@ namespace Game.Entities
|
||||
|
||||
public void SetOriginalGroup(Group group, byte subgroup = 0)
|
||||
{
|
||||
if (!group)
|
||||
if (group == null)
|
||||
m_originalGroup.Unlink();
|
||||
else
|
||||
{
|
||||
@@ -162,7 +162,7 @@ namespace Game.Entities
|
||||
return group;
|
||||
|
||||
Group originalGroup = GetOriginalGroup();
|
||||
if (originalGroup && originalGroup.GetGroupCategory() == category)
|
||||
if (originalGroup != null && originalGroup.GetGroupCategory() == category)
|
||||
return originalGroup;
|
||||
|
||||
return null;
|
||||
@@ -170,7 +170,7 @@ namespace Game.Entities
|
||||
|
||||
public void SetGroup(Group group, byte subgroup = 0)
|
||||
{
|
||||
if (!group)
|
||||
if (group == null)
|
||||
m_group.Unlink();
|
||||
else
|
||||
{
|
||||
@@ -207,11 +207,11 @@ namespace Game.Entities
|
||||
|
||||
public bool IsAtGroupRewardDistance(WorldObject pRewardSource)
|
||||
{
|
||||
if (!pRewardSource || !IsInMap(pRewardSource))
|
||||
if (pRewardSource == null || !IsInMap(pRewardSource))
|
||||
return false;
|
||||
|
||||
WorldObject player = GetCorpse();
|
||||
if (!player || IsAlive())
|
||||
if (player == null || IsAlive())
|
||||
player = this;
|
||||
|
||||
if (player.GetMap().IsDungeon())
|
||||
@@ -259,7 +259,7 @@ namespace Game.Entities
|
||||
}
|
||||
public bool IsInSameGroupWith(Player p)
|
||||
{
|
||||
return p == this || (GetGroup() &&
|
||||
return p == this || (GetGroup() != null &&
|
||||
GetGroup() == p.GetGroup() && GetGroup().SameSubGroup(this, p));
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace Game.Entities
|
||||
public void UninviteFromGroup()
|
||||
{
|
||||
Group group = GetGroupInvite();
|
||||
if (!group)
|
||||
if (group == null)
|
||||
return;
|
||||
|
||||
group.RemoveInvite(this);
|
||||
@@ -291,7 +291,7 @@ namespace Game.Entities
|
||||
public void RemoveFromGroup(RemoveMethod method = RemoveMethod.Default) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
|
||||
public static void RemoveFromGroup(Group group, ObjectGuid guid, RemoveMethod method = RemoveMethod.Default, ObjectGuid kicker = default, string reason = null)
|
||||
{
|
||||
if (!group)
|
||||
if (group == null)
|
||||
return;
|
||||
|
||||
group.RemoveMember(guid, method, kicker, reason);
|
||||
@@ -302,13 +302,13 @@ namespace Game.Entities
|
||||
if (m_groupUpdateMask == GroupUpdateFlags.None)
|
||||
return;
|
||||
Group group = GetGroup();
|
||||
if (group)
|
||||
if (group != null)
|
||||
group.UpdatePlayerOutOfRange(this);
|
||||
|
||||
m_groupUpdateMask = GroupUpdateFlags.None;
|
||||
|
||||
Pet pet = GetPet();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
pet.ResetGroupUpdateFlag();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace Game.Entities
|
||||
foreach (var guid in m_itemSoulboundTradeable.ToList())
|
||||
{
|
||||
Item item = GetItemByGuid(guid);
|
||||
if (!item || item.GetOwnerGUID() != GetGUID() || item.CheckSoulboundTradeExpire())
|
||||
if (item == null || item.GetOwnerGUID() != GetGUID() || item.CheckSoulboundTradeExpire())
|
||||
m_itemSoulboundTradeable.Remove(guid);
|
||||
}
|
||||
}
|
||||
@@ -637,7 +637,7 @@ namespace Game.Entities
|
||||
// search free slot in bag for place to
|
||||
if (bag == InventorySlots.Bag0) // inventory
|
||||
{
|
||||
if (pItem && pItem.HasItemFlag(ItemFieldFlags.Child))
|
||||
if (pItem != null && pItem.HasItemFlag(ItemFieldFlags.Child))
|
||||
{
|
||||
res = CanStoreItem_InInventorySlots(InventorySlots.ChildEquipmentStart, InventorySlots.ChildEquipmentEnd, dest, pProto, ref count, false, pItem, bag, slot);
|
||||
if (res != InventoryResult.Ok)
|
||||
@@ -791,7 +791,7 @@ namespace Game.Entities
|
||||
if (pItem != null && pItem.IsNotEmptyBag())
|
||||
return InventoryResult.BagInBag;
|
||||
|
||||
if (pItem && pItem.HasItemFlag(ItemFieldFlags.Child))
|
||||
if (pItem != null && pItem.HasItemFlag(ItemFieldFlags.Child))
|
||||
{
|
||||
res = CanStoreItem_InInventorySlots(InventorySlots.ChildEquipmentStart, InventorySlots.ChildEquipmentEnd, dest, pProto, ref count, false, pItem, bag, slot);
|
||||
if (res != InventoryResult.Ok)
|
||||
@@ -813,7 +813,7 @@ namespace Game.Entities
|
||||
// search free slot
|
||||
byte searchSlotStart = InventorySlots.ItemStart;
|
||||
// new bags can be directly equipped
|
||||
if (!pItem && pProto.GetClass() == ItemClass.Container && (ItemSubClassContainer)pProto.GetSubClass() == ItemSubClassContainer.Container &&
|
||||
if (pItem == null && pProto.GetClass() == ItemClass.Container && (ItemSubClassContainer)pProto.GetSubClass() == ItemSubClassContainer.Container &&
|
||||
(pProto.GetBonding() == ItemBondingType.None || pProto.GetBonding() == ItemBondingType.OnAcquire))
|
||||
searchSlotStart = InventorySlots.BagStart;
|
||||
|
||||
@@ -874,7 +874,7 @@ namespace Game.Entities
|
||||
{
|
||||
// build items in stock backpack
|
||||
item2 = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (item2 && !item2.IsInTrade())
|
||||
if (item2 != null && !item2.IsInTrade())
|
||||
{
|
||||
inventoryCounts[i - InventorySlots.ItemStart] = item2.GetCount();
|
||||
inventoryPointers[i - InventorySlots.ItemStart] = item2;
|
||||
@@ -884,7 +884,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.BagStart; i < InventorySlots.BagEnd; i++)
|
||||
{
|
||||
Bag pBag = GetBagByPos(i);
|
||||
if (pBag)
|
||||
if (pBag != null)
|
||||
{
|
||||
bagCounts[i - InventorySlots.BagStart] = new uint[ItemConst.MaxBagSize];
|
||||
bagPointers[i - InventorySlots.BagStart] = new Item[ItemConst.MaxBagSize];
|
||||
@@ -892,7 +892,7 @@ namespace Game.Entities
|
||||
{
|
||||
// build item counts in equippable bags
|
||||
item2 = GetItemByPos(i, j);
|
||||
if (item2 && !item2.IsInTrade())
|
||||
if (item2 != null && !item2.IsInTrade())
|
||||
{
|
||||
bagCounts[i - InventorySlots.BagStart][j] = item2.GetCount();
|
||||
bagPointers[i - InventorySlots.BagStart][j] = item2;
|
||||
@@ -908,7 +908,7 @@ namespace Game.Entities
|
||||
Item item = items[k];
|
||||
|
||||
// no item
|
||||
if (!item)
|
||||
if (item == null)
|
||||
continue;
|
||||
|
||||
uint remaining_count = item.GetCount();
|
||||
@@ -942,7 +942,7 @@ namespace Game.Entities
|
||||
for (byte t = InventorySlots.ItemStart; t < inventoryEnd; ++t)
|
||||
{
|
||||
item2 = inventoryPointers[t - InventorySlots.ItemStart];
|
||||
if (item2 && item2.CanBeMergedPartlyWith(pProto) == InventoryResult.Ok && inventoryCounts[t - InventorySlots.ItemStart] < pProto.GetMaxStackSize())
|
||||
if (item2 != null && item2.CanBeMergedPartlyWith(pProto) == InventoryResult.Ok && inventoryCounts[t - InventorySlots.ItemStart] < pProto.GetMaxStackSize())
|
||||
{
|
||||
inventoryCounts[t - InventorySlots.ItemStart] += remaining_count;
|
||||
remaining_count = inventoryCounts[t - InventorySlots.ItemStart] < pProto.GetMaxStackSize() ? 0 : inventoryCounts[t - InventorySlots.ItemStart] - pProto.GetMaxStackSize();
|
||||
@@ -960,7 +960,7 @@ namespace Game.Entities
|
||||
for (byte t = InventorySlots.BagStart; !b_found && t < InventorySlots.BagEnd; ++t)
|
||||
{
|
||||
Bag bag = GetBagByPos(t);
|
||||
if (bag)
|
||||
if (bag != null)
|
||||
{
|
||||
if (!Item.ItemCanGoIntoBag(item.GetTemplate(), bag.GetTemplate()))
|
||||
continue;
|
||||
@@ -968,7 +968,7 @@ namespace Game.Entities
|
||||
for (byte j = 0; j < bag.GetBagSize(); j++)
|
||||
{
|
||||
item2 = bagPointers[t - InventorySlots.BagStart][j];
|
||||
if (item2 && item2.CanBeMergedPartlyWith(pProto) == InventoryResult.Ok && bagCounts[t - InventorySlots.BagStart][j] < pProto.GetMaxStackSize())
|
||||
if (item2 != null && item2.CanBeMergedPartlyWith(pProto) == InventoryResult.Ok && bagCounts[t - InventorySlots.BagStart][j] < pProto.GetMaxStackSize())
|
||||
{
|
||||
// add count to stack so that later items in the list do not double-book
|
||||
bagCounts[t - InventorySlots.BagStart][j] += remaining_count;
|
||||
@@ -994,7 +994,7 @@ namespace Game.Entities
|
||||
for (byte t = InventorySlots.BagStart; !b_found && t < InventorySlots.BagEnd; ++t)
|
||||
{
|
||||
Bag bag = GetBagByPos(t);
|
||||
if (bag)
|
||||
if (bag != null)
|
||||
{
|
||||
pBagProto = bag.GetTemplate();
|
||||
|
||||
@@ -1042,7 +1042,7 @@ namespace Game.Entities
|
||||
for (byte t = InventorySlots.BagStart; !b_found && t < InventorySlots.BagEnd; ++t)
|
||||
{
|
||||
Bag bag = GetBagByPos(t);
|
||||
if (bag)
|
||||
if (bag != null)
|
||||
{
|
||||
pBagProto = bag.GetTemplate();
|
||||
|
||||
@@ -1292,7 +1292,7 @@ namespace Game.Entities
|
||||
List<ItemPosCount> childDest = new();
|
||||
CanStoreItem_InInventorySlots(InventorySlots.ChildEquipmentStart, InventorySlots.ChildEquipmentEnd, childDest, childTemplate, ref count, false, null, ItemConst.NullBag, ItemConst.NullSlot);
|
||||
Item childItem = StoreNewItem(childDest, childTemplate.GetId(), update, 0, null, context, null, addToCollection);
|
||||
if (childItem)
|
||||
if (childItem != null)
|
||||
{
|
||||
childItem.SetCreator(item.GetGUID());
|
||||
childItem.SetItemFlag(ItemFieldFlags.Child);
|
||||
@@ -1644,13 +1644,13 @@ namespace Game.Entities
|
||||
if (itemChildEquipment != null)
|
||||
{
|
||||
Item childItem = GetChildItemByGuid(parentItem.GetChildItem());
|
||||
if (childItem)
|
||||
if (childItem != null)
|
||||
{
|
||||
ushort childDest = (ushort)((InventorySlots.Bag0 << 8) | itemChildEquipment.ChildItemEquipSlot);
|
||||
if (childItem.GetPos() != childDest)
|
||||
{
|
||||
Item dstItem = GetItemByPos(childDest);
|
||||
if (!dstItem) // empty slot, simple case
|
||||
if (dstItem == null) // empty slot, simple case
|
||||
{
|
||||
RemoveItem(childItem.GetBagSlot(), childItem.GetSlot(), true);
|
||||
EquipItem(childDest, childItem, true);
|
||||
@@ -1722,7 +1722,7 @@ namespace Game.Entities
|
||||
if (Global.DB2Mgr.GetItemChildEquipment(parentItem.GetEntry()) != null)
|
||||
{
|
||||
Item childItem = GetChildItemByGuid(parentItem.GetChildItem());
|
||||
if (childItem)
|
||||
if (childItem != null)
|
||||
{
|
||||
if (IsChildEquipmentPos(childItem.GetPos()))
|
||||
return;
|
||||
@@ -1770,10 +1770,10 @@ namespace Game.Entities
|
||||
|
||||
if (msg != InventoryResult.Ok)
|
||||
{
|
||||
if (item1)
|
||||
if (item1 != null)
|
||||
failure.Item[0] = item1.GetGUID();
|
||||
|
||||
if (item2)
|
||||
if (item2 != null)
|
||||
failure.Item[1] = item2.GetGUID();
|
||||
|
||||
failure.ContainerBSlot = 0; // bag equip slot, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2
|
||||
@@ -1783,7 +1783,7 @@ namespace Game.Entities
|
||||
case InventoryResult.CantEquipLevelI:
|
||||
case InventoryResult.PurchaseLevelTooLow:
|
||||
{
|
||||
failure.Level = (item1 ? item1.GetRequiredLevel() : 0);
|
||||
failure.Level = (item1 != null ? item1.GetRequiredLevel() : 0);
|
||||
break;
|
||||
}
|
||||
case InventoryResult.EventAutoequipBindConfirm: // no idea about this one...
|
||||
@@ -1797,7 +1797,7 @@ namespace Game.Entities
|
||||
case InventoryResult.ItemMaxLimitCategorySocketedExceededIs:
|
||||
case InventoryResult.ItemMaxLimitCategoryEquippedExceededIs:
|
||||
{
|
||||
ItemTemplate proto = item1 ? item1.GetTemplate() : Global.ObjectMgr.GetItemTemplate(itemId);
|
||||
ItemTemplate proto = item1 != null ? item1.GetTemplate() : Global.ObjectMgr.GetItemTemplate(itemId);
|
||||
failure.LimitCategory = (int)(proto != null ? proto.GetItemLimitCategory() : 0u);
|
||||
break;
|
||||
}
|
||||
@@ -1924,7 +1924,7 @@ namespace Game.Entities
|
||||
byte dstslot = (byte)(dst & 255);
|
||||
|
||||
Item pSrcItem = GetItemByPos(srcbag, srcslot);
|
||||
if (!pSrcItem)
|
||||
if (pSrcItem == null)
|
||||
{
|
||||
SendEquipError(InventoryResult.ItemNotFound, pSrcItem);
|
||||
return;
|
||||
@@ -1962,7 +1962,7 @@ namespace Game.Entities
|
||||
|
||||
Log.outDebug(LogFilter.Player, "STORAGE: SplitItem bag = {0}, slot = {1}, item = {2}, count = {3}", dstbag, dstslot, pSrcItem.GetEntry(), count);
|
||||
Item pNewItem = pSrcItem.CloneItem(count, this);
|
||||
if (!pNewItem)
|
||||
if (pNewItem == null)
|
||||
{
|
||||
SendEquipError(InventoryResult.ItemNotFound, pSrcItem);
|
||||
return;
|
||||
@@ -2044,7 +2044,7 @@ namespace Game.Entities
|
||||
if (pSrcItem.HasItemFlag(ItemFieldFlags.Child))
|
||||
{
|
||||
Item parentItem = GetItemByGuid(pSrcItem.m_itemData.Creator);
|
||||
if (parentItem)
|
||||
if (parentItem != null)
|
||||
{
|
||||
if (IsEquipmentPos(src))
|
||||
{
|
||||
@@ -2055,10 +2055,10 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pDstItem && pDstItem.HasItemFlag(ItemFieldFlags.Child))
|
||||
else if (pDstItem != null && pDstItem.HasItemFlag(ItemFieldFlags.Child))
|
||||
{
|
||||
Item parentItem = GetItemByGuid(pDstItem.m_itemData.Creator);
|
||||
if (parentItem)
|
||||
if (parentItem != null)
|
||||
{
|
||||
if (IsEquipmentPos(dst))
|
||||
{
|
||||
@@ -2522,7 +2522,7 @@ namespace Game.Entities
|
||||
packet.IsEncounterLoot = true;
|
||||
}
|
||||
|
||||
if (broadcast && GetGroup() && !item.GetTemplate().HasFlag(ItemFlags3.DontReportLootLogToParty))
|
||||
if (broadcast && GetGroup() != null && !item.GetTemplate().HasFlag(ItemFlags3.DontReportLootLogToParty))
|
||||
GetGroup().BroadcastPacket(packet, true);
|
||||
else
|
||||
SendPacket(packet);
|
||||
@@ -2576,7 +2576,7 @@ namespace Game.Entities
|
||||
|
||||
Item pItem = GetItemByPos(InventorySlots.Bag0, slot);
|
||||
|
||||
if (!pItem || pItem.GetSocketColor(0) == 0) //if item has no sockets or no item is equipped go to next item
|
||||
if (pItem == null || pItem.GetSocketColor(0) == 0) //if item has no sockets or no item is equipped go to next item
|
||||
continue;
|
||||
|
||||
//cycle all (gem)enchants
|
||||
@@ -2675,7 +2675,7 @@ namespace Game.Entities
|
||||
public Item GetUseableItemByPos(byte bag, byte slot)
|
||||
{
|
||||
Item item = GetItemByPos(bag, slot);
|
||||
if (!item)
|
||||
if (item == null)
|
||||
return null;
|
||||
|
||||
if (!CanUseAttackType(GetAttackBySlot(slot, item.GetTemplate().GetInventoryType())))
|
||||
@@ -2743,7 +2743,7 @@ namespace Game.Entities
|
||||
uint currentCount = 0;
|
||||
return !ForEachItem(location, pItem =>
|
||||
{
|
||||
if (pItem && pItem.GetEntry() == item && !pItem.IsInTrade())
|
||||
if (pItem != null && pItem.GetEntry() == item && !pItem.IsInTrade())
|
||||
{
|
||||
currentCount += pItem.GetCount();
|
||||
if (currentCount >= count)
|
||||
@@ -2879,7 +2879,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.ItemStart; i < inventoryEnd; i++)
|
||||
{
|
||||
Item pItem = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (pItem)
|
||||
if (pItem != null)
|
||||
{
|
||||
if (pItem.IsConjuredConsumable())
|
||||
DestroyItem(InventorySlots.Bag0, i, update);
|
||||
@@ -2890,12 +2890,12 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.BagStart; i < InventorySlots.BagEnd; i++)
|
||||
{
|
||||
Bag pBag = GetBagByPos(i);
|
||||
if (pBag)
|
||||
if (pBag != null)
|
||||
{
|
||||
for (byte j = 0; j < pBag.GetBagSize(); j++)
|
||||
{
|
||||
Item pItem = pBag.GetItemByPos(j);
|
||||
if (pItem)
|
||||
if (pItem != null)
|
||||
if (pItem.IsConjuredConsumable())
|
||||
DestroyItem(i, j, update);
|
||||
}
|
||||
@@ -2906,7 +2906,7 @@ namespace Game.Entities
|
||||
for (byte i = EquipmentSlot.Start; i < InventorySlots.BagEnd; i++)
|
||||
{
|
||||
Item pItem = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (pItem)
|
||||
if (pItem != null)
|
||||
if (pItem.IsConjuredConsumable())
|
||||
DestroyItem(InventorySlots.Bag0, i, update);
|
||||
}
|
||||
@@ -2920,7 +2920,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.ItemStart; i < inventoryEnd; i++)
|
||||
{
|
||||
Item pItem = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (pItem)
|
||||
if (pItem != null)
|
||||
if (pItem.IsLimitedToAnotherMapOrZone(GetMapId(), new_zone))
|
||||
DestroyItem(InventorySlots.Bag0, i, update);
|
||||
}
|
||||
@@ -2929,12 +2929,12 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.BagStart; i < InventorySlots.BagEnd; i++)
|
||||
{
|
||||
Bag pBag = GetBagByPos(i);
|
||||
if (pBag)
|
||||
if (pBag != null)
|
||||
{
|
||||
for (byte j = 0; j < pBag.GetBagSize(); j++)
|
||||
{
|
||||
Item pItem = pBag.GetItemByPos(j);
|
||||
if (pItem)
|
||||
if (pItem != null)
|
||||
if (pItem.IsLimitedToAnotherMapOrZone(GetMapId(), new_zone))
|
||||
DestroyItem(i, j, update);
|
||||
}
|
||||
@@ -2945,7 +2945,7 @@ namespace Game.Entities
|
||||
for (byte i = EquipmentSlot.Start; i < InventorySlots.BagEnd; i++)
|
||||
{
|
||||
Item pItem = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (pItem)
|
||||
if (pItem != null)
|
||||
if (pItem.IsLimitedToAnotherMapOrZone(GetMapId(), new_zone))
|
||||
DestroyItem(InventorySlots.Bag0, i, update);
|
||||
}
|
||||
@@ -2955,7 +2955,7 @@ namespace Game.Entities
|
||||
{
|
||||
if (restrictOnlyLfg)
|
||||
{
|
||||
if (!GetGroup() || !GetGroup().IsLFGGroup())
|
||||
if (GetGroup() == null || !GetGroup().IsLFGGroup())
|
||||
return InventoryResult.Ok; // not in LFG group
|
||||
|
||||
// check if looted object is inside the lfg dungeon
|
||||
@@ -3008,7 +3008,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.BuyBackStart + 1; i < InventorySlots.BuyBackEnd; ++i)
|
||||
{
|
||||
// found empty
|
||||
if (!m_items[i])
|
||||
if (m_items[i] == null)
|
||||
{
|
||||
oldest_slot = i;
|
||||
break;
|
||||
@@ -3066,7 +3066,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
Creature creature = GetNPCIfCanInteractWith(vendorGuid, NPCFlags.Vendor, NPCFlags2.None);
|
||||
if (!creature)
|
||||
if (creature == null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: BuyCurrencyFromVendorSlot - {0} not found or you can't interact with him.", vendorGuid.ToString());
|
||||
SendBuyError(BuyResult.DistanceTooFar, null, currency);
|
||||
@@ -3233,7 +3233,7 @@ namespace Game.Entities
|
||||
return false;
|
||||
|
||||
Creature creature = GetNPCIfCanInteractWith(vendorguid, NPCFlags.Vendor, NPCFlags2.None);
|
||||
if (!creature)
|
||||
if (creature == null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: BuyItemFromVendor - {0} not found or you can't interact with him.", vendorguid.ToString());
|
||||
SendBuyError(BuyResult.DistanceTooFar, null, item);
|
||||
@@ -3456,7 +3456,7 @@ namespace Game.Entities
|
||||
SQLTransaction trans = new();
|
||||
|
||||
Item item = Item.CreateItem(itemEntry, count, context, null);
|
||||
if (item)
|
||||
if (item != null)
|
||||
{
|
||||
item.SaveToDB(trans);
|
||||
draft.AddItem(item);
|
||||
@@ -3481,7 +3481,7 @@ namespace Game.Entities
|
||||
if (slot >= InventorySlots.BuyBackStart && slot < InventorySlots.BuyBackEnd)
|
||||
{
|
||||
Item pItem = m_items[slot];
|
||||
if (pItem)
|
||||
if (pItem != null)
|
||||
{
|
||||
pItem.RemoveFromWorld();
|
||||
if (del)
|
||||
@@ -3503,7 +3503,7 @@ namespace Game.Entities
|
||||
SetBuybackTimestamp(eslot, 0);
|
||||
|
||||
// if current backslot is filled set to now free slot
|
||||
if (m_items[m_currentBuybackSlot])
|
||||
if (m_items[m_currentBuybackSlot] != null)
|
||||
m_currentBuybackSlot = slot;
|
||||
}
|
||||
}
|
||||
@@ -3518,19 +3518,19 @@ namespace Game.Entities
|
||||
for (byte i = EquipmentSlot.Start; i < inventoryEnd; ++i)
|
||||
{
|
||||
Item item = GetUseableItemByPos(InventorySlots.Bag0, i);
|
||||
if (item && Global.DB2Mgr.IsTotemCategoryCompatibleWith(item.GetTemplate().GetTotemCategory(), TotemCategory))
|
||||
if (item != null && Global.DB2Mgr.IsTotemCategoryCompatibleWith(item.GetTemplate().GetTotemCategory(), TotemCategory))
|
||||
return true;
|
||||
}
|
||||
|
||||
for (byte i = InventorySlots.BagStart; i < InventorySlots.BagEnd; ++i)
|
||||
{
|
||||
Bag bag = GetBagByPos(i);
|
||||
if (bag)
|
||||
if (bag != null)
|
||||
{
|
||||
for (byte j = 0; j < bag.GetBagSize(); ++j)
|
||||
{
|
||||
Item item = GetUseableItemByPos(i, j);
|
||||
if (item && Global.DB2Mgr.IsTotemCategoryCompatibleWith(item.GetTemplate().GetTotemCategory(), TotemCategory))
|
||||
if (item != null && Global.DB2Mgr.IsTotemCategoryCompatibleWith(item.GetTemplate().GetTotemCategory(), TotemCategory))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -3539,7 +3539,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.ChildEquipmentStart; i < InventorySlots.ChildEquipmentEnd; ++i)
|
||||
{
|
||||
Item item = GetUseableItemByPos(InventorySlots.Bag0, i);
|
||||
if (item && Global.DB2Mgr.IsTotemCategoryCompatibleWith(item.GetTemplate().GetTotemCategory(), TotemCategory))
|
||||
if (item != null && Global.DB2Mgr.IsTotemCategoryCompatibleWith(item.GetTemplate().GetTotemCategory(), TotemCategory))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4050,7 +4050,7 @@ namespace Game.Entities
|
||||
{
|
||||
for (byte i = 0; i < InventorySlots.BagEnd; ++i)
|
||||
{
|
||||
if (m_items[i])
|
||||
if (m_items[i] != null)
|
||||
{
|
||||
if (!m_items[i].IsAzeriteItem() || m_items[i].IsBroken() || !CanUseAttackType(Player.GetAttackBySlot(i, m_items[i].GetTemplate().GetInventoryType())))
|
||||
continue;
|
||||
@@ -4064,7 +4064,7 @@ namespace Game.Entities
|
||||
{
|
||||
for (byte i = 0; i < InventorySlots.BagEnd; ++i)
|
||||
{
|
||||
if (m_items[i])
|
||||
if (m_items[i] != null)
|
||||
{
|
||||
if (!m_items[i].IsAzeriteEmpoweredItem() || m_items[i].IsBroken() || !CanUseAttackType(Player.GetAttackBySlot(i, m_items[i].GetTemplate().GetInventoryType())))
|
||||
continue;
|
||||
@@ -4170,7 +4170,7 @@ namespace Game.Entities
|
||||
|
||||
uint need_space;
|
||||
|
||||
if (pSrcItem)
|
||||
if (pSrcItem != null)
|
||||
{
|
||||
if (pSrcItem.IsNotEmptyBag() && !IsBagPos((ushort)((ushort)bag << 8 | slot)))
|
||||
return InventoryResult.DestroyNonemptyBag;
|
||||
@@ -4522,7 +4522,7 @@ namespace Game.Entities
|
||||
++freeSlotCount;
|
||||
|
||||
for (byte i = ProfessionSlots.Start; i < ProfessionSlots.End; ++i)
|
||||
if (!GetItemByPos(InventorySlots.Bag0, i))
|
||||
if (GetItemByPos(InventorySlots.Bag0, i) == null)
|
||||
++freeSlotCount;
|
||||
}
|
||||
|
||||
@@ -4650,7 +4650,7 @@ namespace Game.Entities
|
||||
if (pBag == null || pBag == pSrcItem)
|
||||
return InventoryResult.WrongBagType;
|
||||
|
||||
if (pSrcItem)
|
||||
if (pSrcItem != null)
|
||||
{
|
||||
if (pSrcItem.IsNotEmptyBag())
|
||||
return InventoryResult.DestroyNonemptyBag;
|
||||
@@ -4990,7 +4990,7 @@ namespace Game.Entities
|
||||
if (IsInCombat())
|
||||
return InventoryResult.NotInCombat;
|
||||
Battleground bg = GetBattleground();
|
||||
if (bg)
|
||||
if (bg != null)
|
||||
if (bg.IsArena() && bg.GetStatus() == BattlegroundStatus.InProgress)
|
||||
return InventoryResult.NotDuringArenaMatch;
|
||||
}
|
||||
@@ -5151,7 +5151,7 @@ namespace Game.Entities
|
||||
public InventoryResult CanEquipChildItem(Item parentItem)
|
||||
{
|
||||
Item childItem = GetChildItemByGuid(parentItem.GetChildItem());
|
||||
if (!childItem)
|
||||
if (childItem == null)
|
||||
return InventoryResult.Ok;
|
||||
|
||||
ItemChildEquipmentRecord childEquipement = Global.DB2Mgr.GetItemChildEquipment(parentItem.GetEntry());
|
||||
@@ -5159,7 +5159,7 @@ namespace Game.Entities
|
||||
return InventoryResult.Ok;
|
||||
|
||||
Item dstItem = GetItemByPos(InventorySlots.Bag0, childEquipement.ChildItemEquipSlot);
|
||||
if (!dstItem)
|
||||
if (dstItem == null)
|
||||
return InventoryResult.Ok;
|
||||
|
||||
ushort childDest = (ushort)((InventorySlots.Bag0 << 8) | childEquipement.ChildItemEquipSlot);
|
||||
@@ -5278,7 +5278,7 @@ namespace Game.Entities
|
||||
if (IsInCombat())
|
||||
return InventoryResult.NotInCombat;
|
||||
Battleground bg = GetBattleground();
|
||||
if (bg)
|
||||
if (bg != null)
|
||||
if (bg.IsArena() && bg.GetStatus() == BattlegroundStatus.InProgress)
|
||||
return InventoryResult.NotDuringArenaMatch;
|
||||
}
|
||||
@@ -5403,9 +5403,9 @@ namespace Game.Entities
|
||||
else
|
||||
{
|
||||
AzeriteEmpoweredItem azeriteEmpoweredItem = item.ToAzeriteEmpoweredItem();
|
||||
if (azeriteEmpoweredItem)
|
||||
if (azeriteEmpoweredItem != null)
|
||||
{
|
||||
if (!apply || GetItemByEntry(PlayerConst.ItemIdHeartOfAzeroth, ItemSearchLocation.Equipment))
|
||||
if (!apply || GetItemByEntry(PlayerConst.ItemIdHeartOfAzeroth, ItemSearchLocation.Equipment) != null)
|
||||
{
|
||||
for (int i = 0; i < SharedConst.MaxAzeriteEmpoweredTier; ++i)
|
||||
{
|
||||
@@ -5884,7 +5884,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.BankBagStart; i < InventorySlots.BankBagEnd; i++)
|
||||
{
|
||||
Item item = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (item)
|
||||
if (item != null)
|
||||
{
|
||||
if (item.GetEntry() == itemEntry && !item.IsInTrade())
|
||||
{
|
||||
@@ -5914,7 +5914,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.ReagentStart; i < InventorySlots.ReagentEnd; ++i)
|
||||
{
|
||||
Item item = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (item)
|
||||
if (item != null)
|
||||
{
|
||||
if (item.GetEntry() == itemEntry && !item.IsInTrade())
|
||||
{
|
||||
@@ -5943,7 +5943,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.ChildEquipmentStart; i < InventorySlots.ChildEquipmentEnd; ++i)
|
||||
{
|
||||
Item item = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (item)
|
||||
if (item != null)
|
||||
{
|
||||
if (item.GetEntry() == itemEntry && !item.IsInTrade())
|
||||
{
|
||||
@@ -6017,7 +6017,7 @@ namespace Game.Entities
|
||||
for (byte slot = (byte)(InventorySlots.ItemStart + slots); slot < InventorySlots.ItemEnd; ++slot)
|
||||
{
|
||||
Item unstorableItem = GetItemByPos(InventorySlots.Bag0, slot);
|
||||
if (unstorableItem)
|
||||
if (unstorableItem != null)
|
||||
unstorableItems.Add(unstorableItem);
|
||||
}
|
||||
|
||||
@@ -6110,7 +6110,7 @@ namespace Game.Entities
|
||||
if (newitem.GetQuality() > ItemQuality.Epic || (newitem.GetQuality() == ItemQuality.Epic && newitem.GetItemLevel(this) >= GuildConst.MinNewsItemLevel))
|
||||
{
|
||||
Guild guild = GetGuild();
|
||||
if (guild)
|
||||
if (guild != null)
|
||||
guild.AddGuildNews(GuildNews.ItemLooted, GetGUID(), 0, item.itemid);
|
||||
}
|
||||
}
|
||||
@@ -6162,7 +6162,7 @@ namespace Game.Entities
|
||||
// We have to convert player corpse to bones, not to be able to resurrect there
|
||||
// SpawnCorpseBones isn't handy, 'cos it saves player while he in BG
|
||||
Corpse bones = GetMap().ConvertCorpseToBones(GetGUID(), true);
|
||||
if (!bones)
|
||||
if (bones == null)
|
||||
return;
|
||||
|
||||
// Now we must make bones lootable, and send player loot
|
||||
|
||||
@@ -156,12 +156,12 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
// group update
|
||||
if (GetGroup())
|
||||
if (GetGroup() != null)
|
||||
{
|
||||
SetGroupUpdateFlag(GroupUpdateFlags.Full);
|
||||
|
||||
Pet pet = GetPet();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
pet.SetGroupUpdateFlag(GroupUpdatePetFlags.Full);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace Game.Entities
|
||||
Global.BattleFieldMgr.HandlePlayerEnterZone(this, newZone);
|
||||
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
|
||||
Guild guild = GetGuild();
|
||||
if (guild)
|
||||
if (guild != null)
|
||||
guild.UpdateMemberData(this, GuildMemberData.ZoneId, newZone);
|
||||
}
|
||||
}
|
||||
@@ -437,7 +437,7 @@ namespace Game.Entities
|
||||
if (group == null || group.IsRaidGroup())
|
||||
return false;
|
||||
|
||||
if (group)
|
||||
if (group != null)
|
||||
{
|
||||
// check if player's group is bound to this instance
|
||||
if (group != instance.GetOwningGroup())
|
||||
@@ -495,7 +495,7 @@ namespace Game.Entities
|
||||
{
|
||||
Group group = GetGroup();
|
||||
Difficulty difficulty = group != null ? group.GetDifficultyID(mapEntry) : GetDifficultyID(mapEntry);
|
||||
ObjectGuid instanceOwnerGuid = group ? group.GetRecentInstanceOwner(targetMapId) : GetGUID();
|
||||
ObjectGuid instanceOwnerGuid = group != null ? group.GetRecentInstanceOwner(targetMapId) : GetGUID();
|
||||
|
||||
InstanceLock instanceLock = Global.InstanceLockMgr.FindActiveInstanceLock(instanceOwnerGuid, new MapDb2Entries(mapEntry, Global.DB2Mgr.GetDownscaledMapDifficultyData(targetMapId, ref difficulty)));
|
||||
if (instanceLock != null)
|
||||
@@ -532,7 +532,7 @@ namespace Game.Entities
|
||||
{
|
||||
Map map = Global.MapMgr.FindMap(mapId, instanceId);
|
||||
bool forgetInstance = false;
|
||||
if (map)
|
||||
if (map != null)
|
||||
{
|
||||
InstanceMap instance = map.ToInstanceMap();
|
||||
if (instance != null)
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Game.Entities
|
||||
// do not reward honor in arenas, but enable onkill spellproc
|
||||
if (InArena())
|
||||
{
|
||||
if (!victim || victim == this || !victim.IsTypeId(TypeId.Player))
|
||||
if (victim == null || victim == this || !victim.IsTypeId(TypeId.Player))
|
||||
return false;
|
||||
|
||||
if (GetBGTeam() == victim.ToPlayer().GetBGTeam())
|
||||
@@ -70,7 +70,7 @@ namespace Game.Entities
|
||||
UpdateHonorFields();
|
||||
|
||||
// do not reward honor in arenas, but return true to enable onkill spellproc
|
||||
if (InBattleground() && GetBattleground() && GetBattleground().IsArena())
|
||||
if (InBattleground() && GetBattleground() != null && GetBattleground().IsArena())
|
||||
return true;
|
||||
|
||||
// Promote to float for calculations
|
||||
@@ -78,12 +78,12 @@ namespace Game.Entities
|
||||
|
||||
if (honor_f <= 0)
|
||||
{
|
||||
if (!victim || victim == this || victim.HasAuraType(AuraType.NoPvpCredit))
|
||||
if (victim == null || victim == this || victim.HasAuraType(AuraType.NoPvpCredit))
|
||||
return false;
|
||||
|
||||
victim_guid = victim.GetGUID();
|
||||
Player plrVictim = victim.ToPlayer();
|
||||
if (plrVictim)
|
||||
if (plrVictim != null)
|
||||
{
|
||||
if (GetEffectiveTeam() == plrVictim.GetEffectiveTeam() && !Global.WorldMgr.IsFFAPvPRealm())
|
||||
return false;
|
||||
@@ -179,7 +179,7 @@ namespace Game.Entities
|
||||
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.PvpTokenEnable) && pvptoken)
|
||||
{
|
||||
if (!victim || victim == this || victim.HasAuraType(AuraType.NoPvpCredit))
|
||||
if (victim == null || victim == this || victim.HasAuraType(AuraType.NoPvpCredit))
|
||||
return true;
|
||||
|
||||
if (victim.IsTypeId(TypeId.Player))
|
||||
@@ -511,7 +511,7 @@ namespace Game.Entities
|
||||
public bool CanUseBattlegroundObject(GameObject gameobject)
|
||||
{
|
||||
// It is possible to call this method with a null pointer, only skipping faction check.
|
||||
if (gameobject)
|
||||
if (gameobject != null)
|
||||
{
|
||||
FactionTemplateRecord playerFaction = GetFactionTemplateEntry();
|
||||
FactionTemplateRecord faction = CliDB.FactionTemplateStorage.LookupByKey(gameobject.GetFaction());
|
||||
@@ -592,7 +592,7 @@ namespace Game.Entities
|
||||
public void LeaveBattleground(bool teleportToEntryPoint = true)
|
||||
{
|
||||
Battleground bg = GetBattleground();
|
||||
if (bg)
|
||||
if (bg != null)
|
||||
{
|
||||
bg.RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
|
||||
|
||||
@@ -648,7 +648,7 @@ namespace Game.Entities
|
||||
reportAfkResult.Offender = GetGUID();
|
||||
Battleground bg = GetBattleground();
|
||||
// Battleground also must be in progress!
|
||||
if (!bg || bg != reporter.GetBattleground() || GetEffectiveTeam() != reporter.GetEffectiveTeam() || bg.GetStatus() != BattlegroundStatus.InProgress)
|
||||
if (bg == null || bg != reporter.GetBattleground() || GetEffectiveTeam() != reporter.GetEffectiveTeam() || bg.GetStatus() != BattlegroundStatus.InProgress)
|
||||
{
|
||||
reporter.SendPacket(reportAfkResult);
|
||||
return;
|
||||
|
||||
@@ -707,7 +707,7 @@ namespace Game.Entities
|
||||
if (CanCompleteQuest(quest.Id))
|
||||
CompleteQuest(quest.Id);
|
||||
|
||||
if (!questGiver)
|
||||
if (questGiver == null)
|
||||
return;
|
||||
|
||||
switch (questGiver.GetTypeId())
|
||||
@@ -1190,10 +1190,10 @@ namespace Game.Entities
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(displaySpell.SpellId, GetMap().GetDifficultyID());
|
||||
Unit caster = this;
|
||||
if (questGiver && questGiver.IsTypeMask(TypeMask.Unit) && !quest.HasFlag(QuestFlags.PlayerCastComplete) && !spellInfo.HasTargetType(Targets.UnitCaster))
|
||||
if (questGiver != null && questGiver.IsTypeMask(TypeMask.Unit) && !quest.HasFlag(QuestFlags.PlayerCastComplete) && !spellInfo.HasTargetType(Targets.UnitCaster))
|
||||
{
|
||||
Unit unit = questGiver.ToUnit();
|
||||
if (unit)
|
||||
if (unit != null)
|
||||
caster = unit;
|
||||
}
|
||||
|
||||
@@ -2326,14 +2326,14 @@ namespace Game.Entities
|
||||
public void GroupEventHappens(uint questId, WorldObject pEventObject)
|
||||
{
|
||||
var group = GetGroup();
|
||||
if (group)
|
||||
if (group != null)
|
||||
{
|
||||
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next())
|
||||
{
|
||||
Player player = refe.GetSource();
|
||||
|
||||
// for any leave or dead (with not released body) group member at appropriate distance
|
||||
if (player && player.IsAtGroupRewardDistance(pEventObject) && !player.GetCorpse())
|
||||
if (player != null && player.IsAtGroupRewardDistance(pEventObject) && player.GetCorpse() == null)
|
||||
player.AreaExploredOrEventHappens(questId);
|
||||
}
|
||||
}
|
||||
@@ -2450,7 +2450,7 @@ namespace Game.Entities
|
||||
Quest quest = Global.ObjectMgr.GetQuestTemplate(questId);
|
||||
|
||||
if (!QuestObjective.CanAlwaysBeProgressedInRaid(objectiveType))
|
||||
if (GetGroup() && GetGroup().IsRaidGroup() && !quest.IsAllowedInRaid(GetMap().GetDifficultyID()))
|
||||
if (GetGroup() != null && GetGroup().IsRaidGroup() && !quest.IsAllowedInRaid(GetMap().GetDifficultyID()))
|
||||
continue;
|
||||
|
||||
ushort logSlot = objectiveStatusData.QuestStatusPair.Status.Slot;
|
||||
@@ -2595,7 +2595,7 @@ namespace Game.Entities
|
||||
continue;
|
||||
|
||||
// hide quest if player is in raid-group and quest is no raid quest
|
||||
if (GetGroup() && GetGroup().IsRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))
|
||||
if (GetGroup() != null && GetGroup().IsRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))
|
||||
if (!InBattleground()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later
|
||||
continue;
|
||||
|
||||
@@ -2611,7 +2611,7 @@ namespace Game.Entities
|
||||
|
||||
Quest qInfo = Global.ObjectMgr.GetQuestTemplate(questStatus.Key);
|
||||
// hide quest if player is in raid-group and quest is no raid quest
|
||||
if (GetGroup() && GetGroup().IsRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))
|
||||
if (GetGroup() != null && GetGroup().IsRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))
|
||||
if (!InBattleground())
|
||||
continue;
|
||||
|
||||
@@ -2855,7 +2855,7 @@ namespace Game.Entities
|
||||
packet.SkillLineIDReward = quest.RewardSkillId;
|
||||
packet.NumSkillUpsReward = quest.RewardSkillPoints;
|
||||
|
||||
if (questGiver)
|
||||
if (questGiver != null)
|
||||
{
|
||||
if (questGiver.IsGossip())
|
||||
packet.LaunchGossip = quest.HasFlag(QuestFlags.LaunchGossipComplete);
|
||||
@@ -2910,7 +2910,7 @@ namespace Game.Entities
|
||||
|
||||
public void SendQuestConfirmAccept(Quest quest, Player receiver)
|
||||
{
|
||||
if (!receiver)
|
||||
if (receiver == null)
|
||||
return;
|
||||
|
||||
QuestConfirmAcceptResponse packet = new();
|
||||
@@ -2998,7 +2998,7 @@ namespace Game.Entities
|
||||
{
|
||||
// need also pet quests case support
|
||||
Creature questgiver = ObjectAccessor.GetCreatureOrPetOrVehicle(this, itr);
|
||||
if (!questgiver || questgiver.IsHostileTo(this))
|
||||
if (questgiver == null || questgiver.IsHostileTo(this))
|
||||
continue;
|
||||
|
||||
if (!questgiver.HasNpcFlag(NPCFlags.QuestGiver))
|
||||
@@ -3009,7 +3009,7 @@ namespace Game.Entities
|
||||
else if (itr.IsGameObject())
|
||||
{
|
||||
GameObject questgiver = GetMap().GetGameObject(itr);
|
||||
if (!questgiver || questgiver.GetGoType() != GameObjectTypes.QuestGiver)
|
||||
if (questgiver == null || questgiver.GetGoType() != GameObjectTypes.QuestGiver)
|
||||
continue;
|
||||
|
||||
response.QuestGiver.Add(new QuestGiverInfo(questgiver.GetGUID(), GetQuestDialogStatus(questgiver)));
|
||||
@@ -3048,7 +3048,7 @@ namespace Game.Entities
|
||||
continue;
|
||||
|
||||
// hide quest if player is in raid-group and quest is no raid quest
|
||||
if (GetGroup() && GetGroup().IsRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))
|
||||
if (GetGroup() != null && GetGroup().IsRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))
|
||||
if (!InBattleground()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later
|
||||
continue;
|
||||
|
||||
@@ -3201,7 +3201,7 @@ namespace Game.Entities
|
||||
{
|
||||
case DisplayToastType.NewItem:
|
||||
{
|
||||
if (!item)
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
displayToast.BonusRoll = isBonusRoll;
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace Game.Entities
|
||||
{
|
||||
Pet pet = GetPet();
|
||||
|
||||
if (!pet)
|
||||
if (pet == null)
|
||||
return;
|
||||
|
||||
Log.outDebug(LogFilter.Pet, "Pet Spells Groups");
|
||||
@@ -250,7 +250,7 @@ namespace Game.Entities
|
||||
|
||||
public bool CanSeeSpellClickOn(Creature creature)
|
||||
{
|
||||
if (!creature.HasNpcFlag(NPCFlags.SpellClick))
|
||||
if (creature.HasNpcFlag(NPCFlags.SpellClick))
|
||||
return false;
|
||||
|
||||
var clickBounds = Global.ObjectMgr.GetSpellClickInfoMapBounds(creature.GetEntry());
|
||||
@@ -871,7 +871,7 @@ namespace Game.Entities
|
||||
public void StopCastingBindSight()
|
||||
{
|
||||
WorldObject target = GetViewpoint();
|
||||
if (target)
|
||||
if (target != null)
|
||||
{
|
||||
if (target.IsTypeMask(TypeMask.Unit))
|
||||
{
|
||||
@@ -950,7 +950,7 @@ namespace Game.Entities
|
||||
var enchantDuration = m_enchantDuration[i];
|
||||
if (enchantDuration.slot == slot)
|
||||
{
|
||||
if (enchantDuration.item && enchantDuration.item.GetEnchantmentId(slot) != 0)
|
||||
if (enchantDuration.item != null && enchantDuration.item.GetEnchantmentId(slot) != 0)
|
||||
{
|
||||
// Poisons and DK runes are enchants which are allowed on arenas
|
||||
if (Global.SpellMgr.IsArenaAllowedEnchancment(enchantDuration.item.GetEnchantmentId(slot)))
|
||||
@@ -973,7 +973,7 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.ItemStart; i < inventoryEnd; ++i)
|
||||
{
|
||||
Item pItem = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (pItem && !Global.SpellMgr.IsArenaAllowedEnchancment(pItem.GetEnchantmentId(slot)))
|
||||
if (pItem != null && !Global.SpellMgr.IsArenaAllowedEnchancment(pItem.GetEnchantmentId(slot)))
|
||||
pItem.ClearEnchantment(slot);
|
||||
}
|
||||
|
||||
@@ -981,12 +981,12 @@ namespace Game.Entities
|
||||
for (byte i = InventorySlots.BagStart; i < InventorySlots.BagEnd; ++i)
|
||||
{
|
||||
Bag pBag = GetBagByPos(i);
|
||||
if (pBag)
|
||||
if (pBag != null)
|
||||
{
|
||||
for (byte j = 0; j < pBag.GetBagSize(); j++)
|
||||
{
|
||||
Item pItem = pBag.GetItemByPos(j);
|
||||
if (pItem && !Global.SpellMgr.IsArenaAllowedEnchancment(pItem.GetEnchantmentId(slot)))
|
||||
if (pItem != null && !Global.SpellMgr.IsArenaAllowedEnchancment(pItem.GetEnchantmentId(slot)))
|
||||
pItem.ClearEnchantment(slot);
|
||||
}
|
||||
}
|
||||
@@ -1755,12 +1755,12 @@ namespace Game.Entities
|
||||
case ItemClass.Weapon:
|
||||
{
|
||||
Item item = GetUseableItemByPos(InventorySlots.Bag0, EquipmentSlot.MainHand);
|
||||
if (item)
|
||||
if (item != null)
|
||||
if (item != ignoreItem && item.IsFitToSpellRequirements(spellInfo))
|
||||
return true;
|
||||
|
||||
item = GetUseableItemByPos(InventorySlots.Bag0, EquipmentSlot.OffHand);
|
||||
if (item)
|
||||
if (item != null)
|
||||
if (item != ignoreItem && item.IsFitToSpellRequirements(spellInfo))
|
||||
return true;
|
||||
break;
|
||||
@@ -1790,7 +1790,7 @@ namespace Game.Entities
|
||||
for (byte i = EquipmentSlot.Start; i < EquipmentSlot.MainHand; ++i)
|
||||
{
|
||||
Item item = GetUseableItemByPos(InventorySlots.Bag0, i);
|
||||
if (item)
|
||||
if (item != null)
|
||||
if (item != ignoreItem && item.IsFitToSpellRequirements(spellInfo))
|
||||
return true;
|
||||
}
|
||||
@@ -1801,7 +1801,7 @@ namespace Game.Entities
|
||||
foreach (byte i in new[] { EquipmentSlot.Head, EquipmentSlot.Shoulders, EquipmentSlot.Chest, EquipmentSlot.Waist, EquipmentSlot.Legs, EquipmentSlot.Feet, EquipmentSlot.Wrist, EquipmentSlot.Hands })
|
||||
{
|
||||
Item item = GetUseableItemByPos(InventorySlots.Bag0, i);
|
||||
if (!item || item == ignoreItem || !item.IsFitToSpellRequirements(spellInfo))
|
||||
if (item == null || item == ignoreItem || !item.IsFitToSpellRequirements(spellInfo))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1834,20 +1834,20 @@ namespace Game.Entities
|
||||
for (byte slot = InventorySlots.ItemStart; slot < inventoryEnd; ++slot)
|
||||
{
|
||||
Item item = GetItemByPos(InventorySlots.Bag0, slot);
|
||||
if (item)
|
||||
if (item != null)
|
||||
ApplyItemObtainSpells(item, true);
|
||||
}
|
||||
|
||||
for (byte i = InventorySlots.BagStart; i < InventorySlots.BagEnd; ++i)
|
||||
{
|
||||
Bag bag = GetBagByPos(i);
|
||||
if (!bag)
|
||||
if (bag == null)
|
||||
continue;
|
||||
|
||||
for (byte slot = 0; slot < bag.GetBagSize(); ++slot)
|
||||
{
|
||||
Item item = bag.GetItemByPos(slot);
|
||||
if (item)
|
||||
if (item != null)
|
||||
ApplyItemObtainSpells(item, true);
|
||||
}
|
||||
}
|
||||
@@ -3234,7 +3234,7 @@ namespace Game.Entities
|
||||
{
|
||||
for (byte i = 0; i < InventorySlots.BagEnd; ++i)
|
||||
{
|
||||
if (m_items[i] && !m_items[i].IsBroken() && CanUseAttackType(GetAttackBySlot(i, m_items[i].GetTemplate().GetInventoryType())))
|
||||
if (m_items[i] != null && !m_items[i].IsBroken() && CanUseAttackType(GetAttackBySlot(i, m_items[i].GetTemplate().GetInventoryType())))
|
||||
{
|
||||
ApplyItemEquipSpell(m_items[i], false, true); // remove spells that not fit to form
|
||||
ApplyItemEquipSpell(m_items[i], true, true); // add spells that fit form but not active
|
||||
@@ -3283,7 +3283,7 @@ namespace Game.Entities
|
||||
if (removeActivePetCooldowns)
|
||||
{
|
||||
Pet pet = GetPet();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
pet.GetSpellHistory().ResetAllCooldowns();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace Game.Entities
|
||||
|
||||
// TO-DO: We need more research to know what happens with warlock's reagent
|
||||
Pet pet = GetPet();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
RemovePet(pet, PetSaveMode.NotInSlot);
|
||||
|
||||
ClearAllReactives();
|
||||
@@ -428,7 +428,7 @@ namespace Game.Entities
|
||||
for (byte i = EquipmentSlot.Start; i < EquipmentSlot.End; ++i)
|
||||
{
|
||||
Item equippedItem = GetItemByPos(InventorySlots.Bag0, i);
|
||||
if (equippedItem)
|
||||
if (equippedItem != null)
|
||||
SetVisibleItemSlot(i, equippedItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -932,7 +932,7 @@ namespace Game.Entities
|
||||
if (petStable.CurrentPetIndex == (uint)srcPetSlot)
|
||||
{
|
||||
Pet oldPet = GetPet();
|
||||
if (oldPet && !oldPet.IsAlive())
|
||||
if (oldPet != null && !oldPet.IsAlive())
|
||||
{
|
||||
sess.SendPetStableResult(StableResult.InternalError);
|
||||
return;
|
||||
@@ -1109,7 +1109,7 @@ namespace Game.Entities
|
||||
public void UnsummonPetTemporaryIfAny()
|
||||
{
|
||||
Pet pet = GetPet();
|
||||
if (!pet)
|
||||
if (pet == null)
|
||||
return;
|
||||
|
||||
if (m_temporaryUnsummonedPetNumber == 0 && pet.IsControlled() && !pet.IsTemporarySummoned())
|
||||
@@ -1179,7 +1179,7 @@ namespace Game.Entities
|
||||
public void StopCastingCharm()
|
||||
{
|
||||
Unit charm = GetCharmed();
|
||||
if (!charm)
|
||||
if (charm == null)
|
||||
return;
|
||||
|
||||
if (charm.IsTypeId(TypeId.Unit))
|
||||
@@ -1219,7 +1219,7 @@ namespace Game.Entities
|
||||
public void CharmSpellInitialize()
|
||||
{
|
||||
Unit charm = GetFirstControlled();
|
||||
if (!charm)
|
||||
if (charm == null)
|
||||
return;
|
||||
|
||||
CharmInfo charmInfo = charm.GetCharmInfo();
|
||||
@@ -1257,7 +1257,7 @@ namespace Game.Entities
|
||||
public void PossessSpellInitialize()
|
||||
{
|
||||
Unit charm = GetCharmed();
|
||||
if (!charm)
|
||||
if (charm == null)
|
||||
return;
|
||||
|
||||
CharmInfo charmInfo = charm.GetCharmInfo();
|
||||
@@ -1281,7 +1281,7 @@ namespace Game.Entities
|
||||
public void VehicleSpellInitialize()
|
||||
{
|
||||
Creature vehicle = GetVehicleCreatureBase();
|
||||
if (!vehicle)
|
||||
if (vehicle == null)
|
||||
return;
|
||||
|
||||
PetSpells petSpells = new();
|
||||
@@ -1843,7 +1843,7 @@ namespace Game.Entities
|
||||
// Calculates how many reputation points player gains in victim's enemy factions
|
||||
public void RewardReputation(Unit victim, float rate)
|
||||
{
|
||||
if (!victim || victim.IsTypeId(TypeId.Player))
|
||||
if (victim == null || victim.IsTypeId(TypeId.Player))
|
||||
return;
|
||||
|
||||
if (victim.ToCreature().IsReputationGainDisabled())
|
||||
@@ -2021,7 +2021,7 @@ namespace Game.Entities
|
||||
// The player was ported to another map and loses the duel immediately.
|
||||
// We have to perform this check before the teleport, otherwise the
|
||||
// ObjectAccessor won't find the flag.
|
||||
if (duel != null && GetMapId() != mapid && GetMap().GetGameObject(m_playerData.DuelArbiter))
|
||||
if (duel != null && GetMapId() != mapid && GetMap().GetGameObject(m_playerData.DuelArbiter) != null)
|
||||
DuelComplete(DuelCompleteType.Fled);
|
||||
|
||||
if (GetMapId() == mapid && (!instanceId.HasValue || GetInstanceId() == instanceId))
|
||||
@@ -2045,7 +2045,7 @@ namespace Game.Entities
|
||||
if (!options.HasAnyFlag(TeleportToOptions.NotUnSummonPet))
|
||||
{
|
||||
//same map, only remove pet if out of range for new position
|
||||
if (pet && !pet.IsWithinDist3d(x, y, z, GetMap().GetVisibilityRange()))
|
||||
if (pet != null && !pet.IsWithinDist3d(x, y, z, GetMap().GetVisibilityRange()))
|
||||
UnsummonPetTemporaryIfAny();
|
||||
}
|
||||
|
||||
@@ -2090,7 +2090,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
// Seamless teleport can happen only if cosmetic maps match
|
||||
if (!oldmap || (oldmap.GetEntry().CosmeticParentMapID != mapid && GetMapId() != mEntry.CosmeticParentMapID &&
|
||||
if (oldmap == null || (oldmap.GetEntry().CosmeticParentMapID != mapid && GetMapId() != mEntry.CosmeticParentMapID &&
|
||||
!((oldmap.GetEntry().CosmeticParentMapID != -1) ^ (oldmap.GetEntry().CosmeticParentMapID != mEntry.CosmeticParentMapID))))
|
||||
options &= ~TeleportToOptions.Seamless;
|
||||
|
||||
@@ -2118,7 +2118,7 @@ namespace Game.Entities
|
||||
|
||||
// remove player from Battlegroundon far teleport (when changing maps)
|
||||
Battleground bg = GetBattleground();
|
||||
if (bg)
|
||||
if (bg != null)
|
||||
{
|
||||
// Note: at Battlegroundjoin Battlegroundid set before teleport
|
||||
// and we already will found "current" Battleground
|
||||
@@ -2132,12 +2132,12 @@ namespace Game.Entities
|
||||
{
|
||||
RemoveArenaSpellCooldowns(true);
|
||||
RemoveArenaAuras();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
pet.RemoveArenaAuras();
|
||||
}
|
||||
|
||||
// remove pet on map change
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
UnsummonPetTemporaryIfAny();
|
||||
|
||||
// remove all dyn objects
|
||||
@@ -2259,7 +2259,7 @@ namespace Game.Entities
|
||||
}
|
||||
});
|
||||
|
||||
if (!m_unitMovedByMe.GetVehicleBase() || !m_unitMovedByMe.GetVehicle().GetVehicleInfo().Flags.HasAnyFlag(VehicleFlags.FixedPosition))
|
||||
if (m_unitMovedByMe.GetVehicleBase() == null || !m_unitMovedByMe.GetVehicle().GetVehicleInfo().Flags.HasAnyFlag(VehicleFlags.FixedPosition))
|
||||
RemoveViolatingFlags(mi.HasMovementFlag(MovementFlag.Root), MovementFlag.Root);
|
||||
|
||||
/*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid
|
||||
@@ -2382,7 +2382,7 @@ namespace Game.Entities
|
||||
|
||||
public void SendSummonRequestFrom(Unit summoner)
|
||||
{
|
||||
if (!summoner)
|
||||
if (summoner == null)
|
||||
return;
|
||||
|
||||
// Player already has active summon request
|
||||
@@ -2475,7 +2475,7 @@ namespace Game.Entities
|
||||
// drop flag at summon
|
||||
// this code can be reached only when GM is summoning player who carries flag, because player should be immune to summoning spells when he carries flag
|
||||
Battleground bg = GetBattleground();
|
||||
if (bg)
|
||||
if (bg != null)
|
||||
bg.EventPlayerDroppedFlag(this);
|
||||
|
||||
m_summon_expire = 0;
|
||||
@@ -2626,7 +2626,7 @@ namespace Game.Entities
|
||||
bool canTalk = true;
|
||||
GameObject go = source.ToGameObject();
|
||||
Creature creature = source.ToCreature();
|
||||
if (creature)
|
||||
if (creature != null)
|
||||
{
|
||||
switch (gossipMenuItem.OptionNpc)
|
||||
{
|
||||
@@ -2639,13 +2639,13 @@ namespace Game.Entities
|
||||
canTalk = false;
|
||||
break;
|
||||
case GossipOptionNpc.Battlemaster:
|
||||
if (!creature.CanInteractWithBattleMaster(this, false))
|
||||
if (creature.CanInteractWithBattleMaster(this, false))
|
||||
canTalk = false;
|
||||
break;
|
||||
case GossipOptionNpc.TalentMaster:
|
||||
case GossipOptionNpc.SpecializationMaster:
|
||||
case GossipOptionNpc.GlyphMaster:
|
||||
if (!creature.CanResetTalents(this))
|
||||
if (creature.CanResetTalents(this))
|
||||
canTalk = false;
|
||||
break;
|
||||
case GossipOptionNpc.Stablemaster:
|
||||
@@ -2705,7 +2705,7 @@ namespace Game.Entities
|
||||
}
|
||||
public void SendPreparedGossip(WorldObject source)
|
||||
{
|
||||
if (!source)
|
||||
if (source == null)
|
||||
return;
|
||||
|
||||
if (source.IsTypeId(TypeId.Unit) || source.IsTypeId(TypeId.GameObject))
|
||||
@@ -3450,7 +3450,7 @@ namespace Game.Entities
|
||||
|
||||
public bool IsAllowedToLoot(Creature creature)
|
||||
{
|
||||
if (!creature.IsDead())
|
||||
if (creature.IsDead())
|
||||
return false;
|
||||
|
||||
if (HasPendingBind())
|
||||
@@ -4256,7 +4256,7 @@ namespace Game.Entities
|
||||
if (InBattleground())
|
||||
{
|
||||
Battleground bg = GetBattleground();
|
||||
if (bg)
|
||||
if (bg != null)
|
||||
bg.HandlePlayerResurrect(this);
|
||||
}
|
||||
|
||||
@@ -4299,14 +4299,14 @@ namespace Game.Entities
|
||||
|
||||
public void SetAreaSpiritHealer(Creature creature)
|
||||
{
|
||||
if (!creature)
|
||||
if (creature == null)
|
||||
{
|
||||
_areaSpiritHealerGUID = ObjectGuid.Empty;
|
||||
RemoveAurasDueToSpell(BattlegroundConst.SpellWaitingForResurrect);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!creature.IsAreaSpiritHealer())
|
||||
if (creature.IsAreaSpiritHealer())
|
||||
return;
|
||||
|
||||
_areaSpiritHealerGUID = creature.GetGUID();
|
||||
@@ -4434,7 +4434,7 @@ namespace Game.Entities
|
||||
public void SpawnCorpseBones(bool triggerSave = true)
|
||||
{
|
||||
_corpseLocation = new WorldLocation();
|
||||
if (GetMap().ConvertCorpseToBones(GetGUID()))
|
||||
if (GetMap().ConvertCorpseToBones(GetGUID()) != null)
|
||||
if (triggerSave && !GetSession().PlayerLogoutWithSave()) // at logout we will already store the player
|
||||
SaveToDB(); // prevent loading as ghost without corpse
|
||||
}
|
||||
@@ -4460,7 +4460,7 @@ namespace Game.Entities
|
||||
|
||||
// Special handle for Battlegroundmaps
|
||||
Battleground bg = GetBattleground();
|
||||
if (bg)
|
||||
if (bg != null)
|
||||
closestGrave = bg.GetClosestGraveyard(this);
|
||||
else
|
||||
{
|
||||
@@ -4545,10 +4545,10 @@ namespace Game.Entities
|
||||
int CalculateCorpseReclaimDelay(bool load = false)
|
||||
{
|
||||
Corpse corpse = GetCorpse();
|
||||
if (load && !corpse)
|
||||
if (load && corpse == null)
|
||||
return -1;
|
||||
|
||||
bool pvp = corpse ? corpse.GetCorpseType() == CorpseType.ResurrectablePVP : (m_ExtraFlags & PlayerExtraFlags.PVPDeath) != 0;
|
||||
bool pvp = corpse != null ? corpse.GetCorpseType() == CorpseType.ResurrectablePVP : (m_ExtraFlags & PlayerExtraFlags.PVPDeath) != 0;
|
||||
|
||||
uint delay;
|
||||
if (load)
|
||||
@@ -4696,10 +4696,10 @@ namespace Game.Entities
|
||||
|
||||
public void RemovePet(Pet pet, PetSaveMode mode, bool returnreagent = false)
|
||||
{
|
||||
if (!pet)
|
||||
if (pet == null)
|
||||
pet = GetPet();
|
||||
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Pet, "RemovePet {0}, {1}, {2}", pet.GetEntry(), mode, returnreagent);
|
||||
|
||||
@@ -4707,10 +4707,10 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
if (returnreagent && (pet || m_temporaryUnsummonedPetNumber != 0) && !InBattleground())
|
||||
if (returnreagent && (pet != null || m_temporaryUnsummonedPetNumber != 0) && !InBattleground())
|
||||
{
|
||||
//returning of reagents only for players, so best done here
|
||||
uint spellId = pet ? pet.m_unitData.CreatedBySpell : m_oldpetspell;
|
||||
uint spellId = pet != null ? pet.m_unitData.CreatedBySpell : m_oldpetspell;
|
||||
SpellInfo spellInfo = SpellMgr.GetSpellInfo(spellId, GetMap().GetDifficultyID());
|
||||
|
||||
if (spellInfo != null)
|
||||
@@ -4781,7 +4781,7 @@ namespace Game.Entities
|
||||
{
|
||||
SendPacket(new PetSpells());
|
||||
|
||||
if (GetGroup())
|
||||
if (GetGroup() != null)
|
||||
SetGroupUpdateFlag(GroupUpdateFlags.Pet);
|
||||
}
|
||||
}
|
||||
@@ -4814,7 +4814,7 @@ namespace Game.Entities
|
||||
public bool InArena()
|
||||
{
|
||||
Battleground bg = GetBattleground();
|
||||
if (!bg || !bg.IsArena())
|
||||
if (bg == null || !bg.IsArena())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -5341,7 +5341,7 @@ namespace Game.Entities
|
||||
|
||||
// update level to hunter/summon pet
|
||||
Pet pet = GetPet();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
pet.SynchronizeLevelWithOwner();
|
||||
|
||||
MailLevelReward mailReward = ObjectMgr.GetMailLevelReward(level, GetRace());
|
||||
@@ -5448,7 +5448,7 @@ namespace Game.Entities
|
||||
return null;
|
||||
|
||||
// alive or spirit healer
|
||||
if (!creature.IsAlive() && !creature.GetCreatureDifficulty().TypeFlags.HasFlag(CreatureTypeFlags.InteractWhileDead))
|
||||
if (creature.IsAlive() && !creature.GetCreatureDifficulty().TypeFlags.HasFlag(CreatureTypeFlags.InteractWhileDead))
|
||||
return null;
|
||||
|
||||
// appropriate npc type
|
||||
@@ -5467,7 +5467,7 @@ namespace Game.Entities
|
||||
return null;
|
||||
|
||||
// not allow interaction under control, but allow with own pets
|
||||
if (!creature.GetCharmerGUID().IsEmpty())
|
||||
if (creature.GetCharmerGUID().IsEmpty())
|
||||
return null;
|
||||
|
||||
// not unfriendly/hostile
|
||||
@@ -5475,7 +5475,7 @@ namespace Game.Entities
|
||||
return null;
|
||||
|
||||
// not too far, taken from CGGameUI::SetInteractTarget
|
||||
if (!creature.IsWithinDistInMap(this, creature.GetCombatReach() + 4.0f))
|
||||
if (creature.IsWithinDistInMap(this, creature.GetCombatReach() + 4.0f))
|
||||
return null;
|
||||
|
||||
return creature;
|
||||
@@ -5510,7 +5510,7 @@ namespace Game.Entities
|
||||
public GameObject GetGameObjectIfCanInteractWith(ObjectGuid guid, GameObjectTypes type)
|
||||
{
|
||||
GameObject go = GetGameObjectIfCanInteractWith(guid);
|
||||
if (!go)
|
||||
if (go == null)
|
||||
return null;
|
||||
|
||||
if (go.GetGoType() != type)
|
||||
@@ -5980,7 +5980,7 @@ namespace Game.Entities
|
||||
|
||||
// update level to hunter/summon pet
|
||||
Pet pet = GetPet();
|
||||
if (pet)
|
||||
if (pet != null)
|
||||
pet.SynchronizeLevelWithOwner();
|
||||
}
|
||||
public void InitDataForForm(bool reapplyMods = false)
|
||||
@@ -6246,10 +6246,10 @@ namespace Game.Entities
|
||||
return false;
|
||||
|
||||
// group update
|
||||
if (GetGroup())
|
||||
if (GetGroup() != null)
|
||||
SetGroupUpdateFlag(GroupUpdateFlags.Position);
|
||||
|
||||
if (GetTrader() && !IsWithinDistInMap(GetTrader(), SharedConst.InteractionDistance))
|
||||
if (GetTrader() != null && !IsWithinDistInMap(GetTrader(), SharedConst.InteractionDistance))
|
||||
GetSession().SendCancelTrade();
|
||||
|
||||
CheckAreaExploreAndOutdoor();
|
||||
@@ -6441,7 +6441,7 @@ namespace Game.Entities
|
||||
public void SendBuyError(BuyResult msg, Creature creature, uint item)
|
||||
{
|
||||
BuyFailed packet = new();
|
||||
packet.VendorGUID = creature ? creature.GetGUID() : ObjectGuid.Empty;
|
||||
packet.VendorGUID = creature != null ? creature.GetGUID() : ObjectGuid.Empty;
|
||||
packet.Muid = item;
|
||||
packet.Reason = msg;
|
||||
SendPacket(packet);
|
||||
@@ -6449,7 +6449,7 @@ namespace Game.Entities
|
||||
public void SendSellError(SellResult msg, Creature creature, ObjectGuid guid)
|
||||
{
|
||||
SellResponse sellResponse = new();
|
||||
sellResponse.VendorGUID = creature ? creature.GetGUID() : ObjectGuid.Empty;
|
||||
sellResponse.VendorGUID = creature != null ? creature.GetGUID() : ObjectGuid.Empty;
|
||||
sellResponse.ItemGUIDs.Add(guid);
|
||||
sellResponse.Reason = msg;
|
||||
SendPacket(sellResponse);
|
||||
@@ -6553,7 +6553,7 @@ namespace Game.Entities
|
||||
|
||||
public override void Whisper(uint textId, Player target, bool isBossWhisper = false)
|
||||
{
|
||||
if (!target)
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
BroadcastTextRecord bct = CliDB.BroadcastTextStorage.LookupByKey(textId);
|
||||
@@ -6685,9 +6685,9 @@ namespace Game.Entities
|
||||
bonus_xp = victim != null ? _restMgr.GetRestBonusFor(RestTypes.XP, xp) : 0; // XP resting bonus
|
||||
|
||||
LogXPGain packet = new();
|
||||
packet.Victim = victim ? victim.GetGUID() : ObjectGuid.Empty;
|
||||
packet.Victim = victim != null ? victim.GetGUID() : ObjectGuid.Empty;
|
||||
packet.Original = (int)(xp + bonus_xp);
|
||||
packet.Reason = victim ? PlayerLogXPReason.Kill : PlayerLogXPReason.NoKill;
|
||||
packet.Reason = victim != null ? PlayerLogXPReason.Kill : PlayerLogXPReason.NoKill;
|
||||
packet.Amount = (int)xp;
|
||||
packet.GroupBonus = group_rate;
|
||||
SendPacket(packet);
|
||||
@@ -7154,12 +7154,12 @@ namespace Game.Entities
|
||||
if (GetLevel() <= WorldConfig.GetIntValue(WorldCfg.MaxRecruitAFriendBonusPlayerLevel) || !forXP)
|
||||
{
|
||||
Group group = GetGroup();
|
||||
if (group)
|
||||
if (group != null)
|
||||
{
|
||||
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next())
|
||||
{
|
||||
Player player = refe.GetSource();
|
||||
if (!player)
|
||||
if (player == null)
|
||||
continue;
|
||||
|
||||
if (!player.IsAtRecruitAFriendDistance(this))
|
||||
@@ -7192,11 +7192,11 @@ namespace Game.Entities
|
||||
|
||||
bool IsAtRecruitAFriendDistance(WorldObject pOther)
|
||||
{
|
||||
if (!pOther || !IsInMap(pOther))
|
||||
if (pOther == null || !IsInMap(pOther))
|
||||
return false;
|
||||
|
||||
WorldObject player = GetCorpse();
|
||||
if (!player || IsAlive())
|
||||
if (player == null || IsAlive())
|
||||
player = this;
|
||||
|
||||
return pOther.GetDistance(player) <= WorldConfig.GetFloatValue(WorldCfg.MaxRecruitAFriendDistance);
|
||||
@@ -7228,7 +7228,7 @@ namespace Game.Entities
|
||||
randomRoll.RollerWowAccount = GetSession().GetAccountGUID();
|
||||
|
||||
Group group = GetGroup();
|
||||
if (group)
|
||||
if (group != null)
|
||||
group.BroadcastPacket(randomRoll, false);
|
||||
else
|
||||
SendPacket(randomRoll);
|
||||
@@ -7409,7 +7409,7 @@ namespace Game.Entities
|
||||
public void SetClientControl(Unit target, bool allowMove)
|
||||
{
|
||||
// a player can never client control nothing
|
||||
Cypher.Assert(target);
|
||||
Cypher.Assert(target != null);
|
||||
|
||||
// don't allow possession to be overridden
|
||||
if (target.HasUnitState(UnitState.Charmed) && (GetGUID() != target.GetCharmerGUID()))
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Game.Entities
|
||||
|
||||
public static void GetFriendInfo(Player player, ObjectGuid friendGUID, FriendInfo friendInfo)
|
||||
{
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
friendInfo.Status = FriendStatus.Offline;
|
||||
@@ -31,7 +31,7 @@ namespace Game.Entities
|
||||
friendInfo.Class = 0;
|
||||
|
||||
Player target = Global.ObjAccessor.FindPlayer(friendGUID);
|
||||
if (!target)
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
var playerFriendInfo = player.GetSocial().PlayerSocialMap.LookupByKey(friendGUID);
|
||||
@@ -84,7 +84,7 @@ namespace Game.Entities
|
||||
|
||||
void BroadcastToFriendListers(Player player, ServerPacket packet)
|
||||
{
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
AccountTypes gmSecLevel = (AccountTypes)WorldConfig.GetIntValue(WorldCfg.GmLevelInWhoList);
|
||||
@@ -94,7 +94,7 @@ namespace Game.Entities
|
||||
if (info != null && info.Flags.HasAnyFlag(SocialFlag.Friend))
|
||||
{
|
||||
Player target = Global.ObjAccessor.FindPlayer(pair.Key);
|
||||
if (!target || !target.IsInWorld)
|
||||
if (target == null || !target.IsInWorld)
|
||||
continue;
|
||||
|
||||
WorldSession session = target.GetSession();
|
||||
@@ -244,7 +244,7 @@ namespace Game.Entities
|
||||
|
||||
public void SendSocialList(Player player, SocialFlag flags)
|
||||
{
|
||||
if (!player)
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
uint friendsCount = 0;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Game.Entities
|
||||
|
||||
public void SetItem(TradeSlots slot, Item item, bool update = false)
|
||||
{
|
||||
ObjectGuid itemGuid = item ? item.GetGUID() : ObjectGuid.Empty;
|
||||
ObjectGuid itemGuid = item != null ? item.GetGUID() : ObjectGuid.Empty;
|
||||
|
||||
if (m_items[(int)slot] == itemGuid && !update)
|
||||
return;
|
||||
@@ -77,7 +77,7 @@ namespace Game.Entities
|
||||
|
||||
public void SetSpell(uint spell_id, Item castItem = null)
|
||||
{
|
||||
ObjectGuid itemGuid = castItem ? castItem.GetGUID() : ObjectGuid.Empty;
|
||||
ObjectGuid itemGuid = castItem != null ? castItem.GetGUID() : ObjectGuid.Empty;
|
||||
|
||||
if (m_spell == spell_id && m_spellCastItem == itemGuid)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user