Some cleanups. (might break build for scripts as they are a WIP)
This commit is contained in:
@@ -30,12 +30,12 @@ namespace Game
|
||||
}
|
||||
else if (guid.IsGameObject())
|
||||
{
|
||||
if (!GetPlayer().GetGameObjectIfCanInteractWith(guid, GameObjectTypes.Mailbox))
|
||||
if (GetPlayer().GetGameObjectIfCanInteractWith(guid, GameObjectTypes.Mailbox) == null)
|
||||
return false;
|
||||
}
|
||||
else if (guid.IsAnyTypeCreature())
|
||||
{
|
||||
if (!GetPlayer().GetNPCIfCanInteractWith(guid, NPCFlags.Mailbox, NPCFlags2.None))
|
||||
if (GetPlayer().GetNPCIfCanInteractWith(guid, NPCFlags.Mailbox, NPCFlags2.None) == null)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -389,7 +389,7 @@ namespace Game
|
||||
foreach (var itemInfo in m.items)
|
||||
{
|
||||
Item item = player.GetMItem(itemInfo.item_guid);
|
||||
if (item)
|
||||
if (item != null)
|
||||
draft.AddItem(item);
|
||||
player.RemoveMItem(itemInfo.item_guid);
|
||||
}
|
||||
@@ -454,7 +454,7 @@ namespace Game
|
||||
if (HasPermission(RBACPermissions.LogGmTrade))
|
||||
{
|
||||
string sender_name;
|
||||
if (receiver)
|
||||
if (receiver != null)
|
||||
{
|
||||
sender_accId = receiver.GetSession().GetAccountId();
|
||||
sender_name = receiver.GetName();
|
||||
@@ -470,11 +470,11 @@ namespace Game
|
||||
Log.outCommand(GetAccountId(), "GM {0} (Account: {1}) receiver mail item: {2} (Entry: {3} Count: {4}) and send COD money: {5} to player: {6} (Account: {7})",
|
||||
GetPlayerName(), GetAccountId(), it.GetTemplate().GetName(), it.GetEntry(), it.GetCount(), m.COD, sender_name, sender_accId);
|
||||
}
|
||||
else if (!receiver)
|
||||
else if (receiver == null)
|
||||
sender_accId = Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(sender_guid);
|
||||
|
||||
// check player existence
|
||||
if (receiver || sender_accId != 0)
|
||||
if (receiver != null || sender_accId != 0)
|
||||
{
|
||||
new MailDraft(m.subject, "")
|
||||
.AddMoney(m.COD)
|
||||
|
||||
Reference in New Issue
Block a user