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
+5 -5
View File
@@ -246,7 +246,7 @@ namespace Game.Loots
continue;
Player player = Global.ObjAccessor.GetPlayer(m_map, playerGuid);
if (!player)
if (player == null)
continue;
player.RemoveLootRoll(this);
@@ -441,7 +441,7 @@ namespace Game.Loots
foreach (ObjectGuid allowedLooter in m_lootItem.GetAllowedLooters())
{
Player plr = Global.ObjAccessor.GetPlayer(m_map, allowedLooter);
if (!plr || !m_lootItem.HasAllowedLooter(plr.GetGUID())) // check if player meet the condition to be able to roll this item
if (plr == null || !m_lootItem.HasAllowedLooter(plr.GetGUID())) // check if player meet the condition to be able to roll this item
{
m_rollVoteMap[allowedLooter].Vote = RollVote.NotValid;
continue;
@@ -650,7 +650,7 @@ namespace Game.Loots
public Loot(Map map, ObjectGuid owner, LootType type, Group group)
{
loot_type = type;
_guid = map ? ObjectGuid.Create(HighGuid.LootObject, map.GetId(), 0, map.GenerateLowGuid(HighGuid.LootObject)) : ObjectGuid.Empty;
_guid = map != null ? ObjectGuid.Create(HighGuid.LootObject, map.GetId(), 0, map.GenerateLowGuid(HighGuid.LootObject)) : ObjectGuid.Empty;
_owner = owner;
_itemContext = ItemContext.None;
_lootMethod = group != null ? group.GetLootMethod() : LootMethod.FreeForAll;
@@ -771,7 +771,7 @@ namespace Game.Loots
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next())
{
Player player = refe.GetSource();
if (player) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter
if (player != null) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter
if (player.IsAtGroupRewardDistance(lootOwner))
FillNotNormalLootFor(player);
}
@@ -860,7 +860,7 @@ namespace Game.Loots
continue;
Player player = Global.ObjAccessor.GetPlayer(map, PlayersLooting[i]);
if (player)
if (player != null)
player.SendNotifyLootItemRemoved(GetGUID(), GetOwnerGUID(), lootListId);
else
PlayersLooting.RemoveAt(i);
+1 -1
View File
@@ -1282,7 +1282,7 @@ namespace Game.Loots
if ((item.lootmode & _lootMode) == 0)
return true;
if (_personalLooter && !LootItem.AllowedForPlayer(_personalLooter, null, item.itemid, item.needs_quest,
if (_personalLooter != null && !LootItem.AllowedForPlayer(_personalLooter, null, item.itemid, item.needs_quest,
!item.needs_quest || Global.ObjectMgr.GetItemTemplate(item.itemid).HasFlag(ItemFlagsCustom.FollowLootRules),
true, item.conditions))
return true;