August 25, 20205 yr Hello! Please tell me the noob what is the difference between IsValid and != null. I've noticed that IsValid doesn't works correctly in some cases when I add check for objects/npcs/players, for example like this: var ganker = ObjectManager.GetObjectWoWPlayer().FirstOrDefault(g => g.IsAttackable && g.GetDistance < 150 && !g.IsDead); Thanks in advance for answers!
August 25, 20205 yr IsValid checks if it still exists in objectmanager. You never need it, unless you store a unit over a long period of time. Because when you move 100 yards from the point of unit acquire, it might have disappeared from the objectmanager and not been updated either.
Create an account or sign in to comment