Misc fixes

This commit is contained in:
hondacrx
2021-03-04 12:00:58 -05:00
parent 2949a2514c
commit 0fdab8635d
8 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -627,7 +627,7 @@ namespace Game
{
Player player = Global.ObjAccessor.FindPlayer(playerCalendarEvent.InviteeGuid);
if (player)
if (!calendarEvent.IsGuildEvent() || (calendarEvent.IsGuildEvent() && player.GetGuildId() != calendarEvent.GuildId))
if (!calendarEvent.IsGuildEvent() || player.GetGuildId() != calendarEvent.GuildId)
player.SendPacket(packet);
}
}
+1 -1
View File
@@ -2687,7 +2687,7 @@ namespace Game.Entities
Log.outError(LogFilter.Player, "Player (guidlow {0}) have invalid coordinates (MapId: {1} {2}). Teleport to default race/class locations.", guid.ToString(), mapId, GetPosition());
RelocateToHomebind();
}
else if (mapEntry != null && mapEntry.IsBattlegroundOrArena())
else if (mapEntry.IsBattlegroundOrArena())
{
Battleground currentBg = null;
if (m_bgData.bgInstanceID != 0) //saved in Battleground
+1 -1
View File
@@ -2460,7 +2460,7 @@ namespace Game.Entities
}
}
if (!released && IsBagPos(dst) && pDstItem != null)
if (!released && IsBagPos(dst))
{
Bag bag = pDstItem.ToBag();
for (byte i = 0; i < bag.GetBagSize(); ++i)
+2 -2
View File
@@ -898,7 +898,7 @@ namespace Game.Entities
break;
}
}
if (item != null && duration > 0)
if (duration > 0)
{
GetSession().SendItemEnchantTimeUpdate(GetGUID(), item.GetGUID(), (uint)slot, duration / 1000);
m_enchantDuration.Add(new EnchantDuration(item, slot, duration));
@@ -2202,7 +2202,7 @@ namespace Game.Entities
}
// now re-learn if need re-activate
if (cur_active && !prevSpell.Active && learnLowRank)
if (!prevSpell.Active && learnLowRank)
{
if (AddSpell(prev_id, true, false, prevSpell.Dependent, prevSpell.Disabled))
{
+1 -1
View File
@@ -4626,7 +4626,7 @@ namespace Game.Entities
if (pet == null)
return null;
if (IsInWorld && pet != null)
if (IsInWorld)
return pet;
}
-1
View File
@@ -420,7 +420,6 @@ namespace Game
short event_id = result.Read<byte>(1);
int internal_event_id = mGameEvent.Length + event_id - 1;
GameObjectData data = Global.ObjectMgr.GetGameObjectData(guid);
if (data == null)
{
+1 -1
View File
@@ -187,7 +187,7 @@ namespace Game
pet.ClearUnitState(UnitState.Follow);
// This is true if pet has no target or has target but targets differs.
if (pet.GetVictim() != TargetUnit || (pet.GetVictim() == TargetUnit && !pet.GetCharmInfo().IsCommandAttack()))
if (pet.GetVictim() != TargetUnit || !pet.GetCharmInfo().IsCommandAttack())
{
if (pet.GetVictim())
pet.AttackStop();
+1 -1
View File
@@ -4881,7 +4881,7 @@ namespace Game.Spells
FactionTemplateRecord casterFaction = caster.GetFactionTemplateEntry();
FactionTemplateRecord targetFaction = CliDB.FactionTemplateStorage.LookupByKey(gameObjTarget.GetFaction());
// Do not allow to damage GO's of friendly factions (ie: Wintergrasp Walls/Ulduar Storm Beacons)
if (targetFaction == null || (casterFaction != null && targetFaction != null && !casterFaction.IsFriendlyTo(targetFaction)))
if (targetFaction == null || (casterFaction != null && !casterFaction.IsFriendlyTo(targetFaction)))
gameObjTarget.ModifyHealth(-damage, caster, GetSpellInfo().Id);
}