Fixes alot of little errors.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user