Some cleanups. (might break build for scripts as they are a WIP)
This commit is contained in:
@@ -16,11 +16,11 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.ArtifactAddPower, Processing = PacketProcessing.Inplace)]
|
||||
void HandleArtifactAddPower(ArtifactAddPower artifactAddPower)
|
||||
{
|
||||
if (!_player.GetGameObjectIfCanInteractWith(artifactAddPower.ForgeGUID, GameObjectTypes.ItemForge))
|
||||
if (_player.GetGameObjectIfCanInteractWith(artifactAddPower.ForgeGUID, GameObjectTypes.ItemForge) == null)
|
||||
return;
|
||||
|
||||
Item artifact = _player.GetItemByGuid(artifactAddPower.ArtifactGUID);
|
||||
if (!artifact || artifact.IsArtifactDisabled())
|
||||
if (artifact == null || artifact.IsArtifactDisabled())
|
||||
return;
|
||||
|
||||
uint currentArtifactTier = artifact.GetModifier(ItemModifier.ArtifactTier);
|
||||
@@ -146,7 +146,7 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.ArtifactSetAppearance, Processing = PacketProcessing.Inplace)]
|
||||
void HandleArtifactSetAppearance(ArtifactSetAppearance artifactSetAppearance)
|
||||
{
|
||||
if (!_player.GetGameObjectIfCanInteractWith(artifactSetAppearance.ForgeGUID, GameObjectTypes.ItemForge))
|
||||
if (_player.GetGameObjectIfCanInteractWith(artifactSetAppearance.ForgeGUID, GameObjectTypes.ItemForge) == null)
|
||||
return;
|
||||
|
||||
ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(artifactSetAppearance.ArtifactAppearanceID);
|
||||
@@ -154,7 +154,7 @@ namespace Game
|
||||
return;
|
||||
|
||||
Item artifact = _player.GetItemByGuid(artifactSetAppearance.ArtifactGUID);
|
||||
if (!artifact)
|
||||
if (artifact == null)
|
||||
return;
|
||||
|
||||
ArtifactAppearanceSetRecord artifactAppearanceSet = CliDB.ArtifactAppearanceSetStorage.LookupByKey(artifactAppearance.ArtifactAppearanceSetID);
|
||||
@@ -170,7 +170,7 @@ namespace Game
|
||||
artifact.SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearance.Id);
|
||||
artifact.SetState(ItemUpdateState.Changed, _player);
|
||||
Item childItem = _player.GetChildItemByGuid(artifact.GetChildItem());
|
||||
if (childItem)
|
||||
if (childItem != null)
|
||||
{
|
||||
childItem.SetAppearanceModId(artifactAppearance.ItemAppearanceModifierID);
|
||||
childItem.SetState(ItemUpdateState.Changed, _player);
|
||||
@@ -180,7 +180,7 @@ namespace Game
|
||||
{
|
||||
// change weapon appearance
|
||||
_player.SetVisibleItemSlot(artifact.GetSlot(), artifact);
|
||||
if (childItem)
|
||||
if (childItem != null)
|
||||
_player.SetVisibleItemSlot(childItem.GetSlot(), childItem);
|
||||
|
||||
// change druid form appearance
|
||||
@@ -192,11 +192,11 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.ConfirmArtifactRespec)]
|
||||
void HandleConfirmArtifactRespec(ConfirmArtifactRespec confirmArtifactRespec)
|
||||
{
|
||||
if (!_player.GetNPCIfCanInteractWith(confirmArtifactRespec.NpcGUID, NPCFlags.ArtifactPowerRespec, NPCFlags2.None))
|
||||
if (_player.GetNPCIfCanInteractWith(confirmArtifactRespec.NpcGUID, NPCFlags.ArtifactPowerRespec, NPCFlags2.None) == null)
|
||||
return;
|
||||
|
||||
Item artifact = _player.GetItemByGuid(confirmArtifactRespec.ArtifactGUID);
|
||||
if (!artifact || artifact.IsArtifactDisabled())
|
||||
if (artifact == null || artifact.IsArtifactDisabled())
|
||||
return;
|
||||
|
||||
ulong xpCost = 0;
|
||||
|
||||
Reference in New Issue
Block a user