Fixes alot of little errors.
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Game.AI
|
||||
else if (creature.IsCritter() && !creature.HasUnitTypeMask(UnitTypeMask.Guardian))
|
||||
return new CritterAI(creature);
|
||||
|
||||
if (creature.IsCivilian() && !creature.IsNeutralToAll())
|
||||
if (!creature.IsCivilian() && !creature.IsNeutralToAll())
|
||||
return new AggressorAI(creature);
|
||||
|
||||
if (creature.IsCivilian() || creature.IsNeutralToAll())
|
||||
|
||||
@@ -487,7 +487,7 @@ namespace Game.BattleFields
|
||||
creature.SetVisible(true);
|
||||
creature.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
creature.SetUninteractible(false);
|
||||
if (creature.IsAlive())
|
||||
if (!creature.IsAlive())
|
||||
creature.Respawn(true);
|
||||
if (aggressive)
|
||||
creature.SetReactState(ReactStates.Aggressive);
|
||||
|
||||
@@ -3066,6 +3066,9 @@ namespace Game
|
||||
|
||||
public bool IsEmpty()
|
||||
{
|
||||
if (Conditions == null)
|
||||
return true;
|
||||
|
||||
return Conditions.Empty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -777,7 +777,7 @@ namespace Game.Entities
|
||||
lowGuid = map.GenerateLowGuid(HighGuid.Creature);
|
||||
|
||||
Creature creature = new();
|
||||
if (creature.Create(lowGuid, map, entry, pos, null, vehId))
|
||||
if (!creature.Create(lowGuid, map, entry, pos, null, vehId))
|
||||
return null;
|
||||
|
||||
return creature;
|
||||
@@ -786,7 +786,7 @@ namespace Game.Entities
|
||||
public static Creature CreateCreatureFromDB(ulong spawnId, Map map, bool addToMap = true, bool allowDuplicate = false)
|
||||
{
|
||||
Creature creature = new();
|
||||
if (creature.LoadFromDB(spawnId, map, addToMap, allowDuplicate))
|
||||
if (!creature.LoadFromDB(spawnId, map, addToMap, allowDuplicate))
|
||||
return null;
|
||||
|
||||
return creature;
|
||||
|
||||
@@ -255,7 +255,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());
|
||||
|
||||
@@ -2613,13 +2613,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:
|
||||
@@ -3435,7 +3435,7 @@ namespace Game.Entities
|
||||
|
||||
public bool IsAllowedToLoot(Creature creature)
|
||||
{
|
||||
if (creature.IsDead())
|
||||
if (!creature.IsDead())
|
||||
return false;
|
||||
|
||||
if (HasPendingBind())
|
||||
@@ -4303,7 +4303,7 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
if (creature.IsAreaSpiritHealer())
|
||||
if (!creature.IsAreaSpiritHealer())
|
||||
return;
|
||||
|
||||
_areaSpiritHealerGUID = creature.GetGUID();
|
||||
|
||||
@@ -377,7 +377,7 @@ namespace Game.Entities
|
||||
// because the current GameObjectModel cannot be moved without recreating
|
||||
creature.AddUnitState(UnitState.IgnorePathfinding);
|
||||
|
||||
if (creature.IsPositionValid())
|
||||
if (!creature.IsPositionValid())
|
||||
{
|
||||
Log.outError(LogFilter.Transport, "Creature (guidlow {0}, entry {1}) not created. Suggested coordinates aren't valid (X: {2} Y: {3})", creature.GetGUID().ToString(), creature.GetEntry(), creature.GetPositionX(), creature.GetPositionY());
|
||||
return null;
|
||||
|
||||
@@ -1031,10 +1031,10 @@ namespace Game.Entities
|
||||
{
|
||||
Log.outDebug(LogFilter.Unit, "DealDamageNotPlayer");
|
||||
|
||||
if (creature.IsPet())
|
||||
if (!creature.IsPet())
|
||||
{
|
||||
// must be after setDeathState which resets dynamic flags
|
||||
if (creature.IsFullyLooted())
|
||||
if (!creature.IsFullyLooted())
|
||||
creature.SetDynamicFlag(UnitDynFlags.Lootable);
|
||||
else
|
||||
creature.AllLootRemovedFromCorpse();
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
if (creature.IsWithinDistInMap(player, AELootCreatureCheck.LootDistance))
|
||||
if (!creature.IsWithinDistInMap(player, AELootCreatureCheck.LootDistance))
|
||||
{
|
||||
player.SendLootError(req.Object, lguid, LootError.TooFar);
|
||||
continue;
|
||||
@@ -359,7 +359,7 @@ namespace Game
|
||||
creature.RemoveDynamicFlag(UnitDynFlags.Lootable);
|
||||
|
||||
// skip pickpocketing loot for speed, skinning timer reduction is no-op in fact
|
||||
if (creature.IsAlive())
|
||||
if (!creature.IsAlive())
|
||||
creature.AllLootRemovedFromCorpse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace Game.Maps
|
||||
Creature creature = objs[i];
|
||||
CreatureUnitRelocationWorker(i_creature, creature);
|
||||
|
||||
if (creature.IsNeedNotify(NotifyFlags.VisibilityChanged))
|
||||
if (!creature.IsNeedNotify(NotifyFlags.VisibilityChanged))
|
||||
CreatureUnitRelocationWorker(creature, i_creature);
|
||||
}
|
||||
}
|
||||
@@ -318,7 +318,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.IsNeedNotify(NotifyFlags.VisibilityChanged))
|
||||
if (!creature.IsNeedNotify(NotifyFlags.VisibilityChanged))
|
||||
continue;
|
||||
|
||||
CreatureRelocationNotifier relocate = new(creature);
|
||||
@@ -450,7 +450,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.InSamePhase(i_phaseShift))
|
||||
if (!creature.InSamePhase(i_phaseShift))
|
||||
continue;
|
||||
|
||||
if ((!required3dDist ? creature.GetExactDist2dSq(i_source) : creature.GetExactDistSq(i_source)) > i_distSq)
|
||||
@@ -545,7 +545,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.InSamePhase(i_phaseShift))
|
||||
if (!creature.InSamePhase(i_phaseShift))
|
||||
continue;
|
||||
|
||||
if (creature.GetExactDist2dSq(i_source) > i_distSq)
|
||||
@@ -850,7 +850,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.GetSharedVisionList().Empty())
|
||||
if (!creature.GetSharedVisionList().Empty())
|
||||
{
|
||||
foreach (var visionPlayer in creature.GetSharedVisionList())
|
||||
BuildPacket(visionPlayer);
|
||||
@@ -1070,7 +1070,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.InSamePhase(i_phaseShift))
|
||||
if (!creature.InSamePhase(i_phaseShift))
|
||||
continue;
|
||||
|
||||
if (i_check.Invoke(creature))
|
||||
@@ -1253,7 +1253,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.InSamePhase(i_phaseShift))
|
||||
if (!creature.InSamePhase(i_phaseShift))
|
||||
continue;
|
||||
|
||||
if (i_check.Invoke(creature))
|
||||
@@ -1585,7 +1585,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.InSamePhase(i_phaseShift))
|
||||
if (!creature.InSamePhase(i_phaseShift))
|
||||
continue;
|
||||
|
||||
if (i_check.Invoke(creature))
|
||||
@@ -1629,7 +1629,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.InSamePhase(i_phaseShift))
|
||||
if (!creature.InSamePhase(i_phaseShift))
|
||||
continue;
|
||||
|
||||
if (i_check.Invoke(creature))
|
||||
@@ -1697,7 +1697,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.InSamePhase(i_phaseShift))
|
||||
if (!creature.InSamePhase(i_phaseShift))
|
||||
continue;
|
||||
|
||||
if (i_check.Invoke(creature))
|
||||
@@ -1728,7 +1728,7 @@ namespace Game.Maps
|
||||
for (var i = 0; i < objs.Count; ++i)
|
||||
{
|
||||
Creature creature = objs[i];
|
||||
if (creature.InSamePhase(i_phaseShift))
|
||||
if (!creature.InSamePhase(i_phaseShift))
|
||||
continue;
|
||||
|
||||
if (i_check.Invoke(creature))
|
||||
|
||||
@@ -1193,7 +1193,7 @@ namespace Game.Maps
|
||||
{
|
||||
// if creature can't be move in new cell/grid (not loaded) move it to repawn cell/grid
|
||||
// creature coordinates will be updated and notifiers send
|
||||
if (CreatureRespawnRelocation(creature, false))
|
||||
if (!CreatureRespawnRelocation(creature, false))
|
||||
{
|
||||
// ... or unload (if respawn grid also not loaded)
|
||||
//This may happen when a player just logs in and a pet moves to a nearby unloaded cell
|
||||
|
||||
Reference in New Issue
Block a user