Pudge 24 Posted August 25, 2020 Share Posted August 25, 2020 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! Link to comment https://wrobot.eu/forums/topic/12452-isvalid-and-null/ Share on other sites More sharing options...
Matenia 628 Posted August 25, 2020 Share Posted August 25, 2020 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. Pudge 1 Link to comment https://wrobot.eu/forums/topic/12452-isvalid-and-null/#findComment-59689 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now