Infusion icon indicating copy to clipboard operation
Infusion copied to clipboard

Consider using null pattern for GameObjects

Open JakubLinhart opened this issue 7 years ago • 1 comments

So it is not necessary to check a GameObject for null when retrieving it from UO.Items/Mobiles/Corpses.

Something like this should be possible then:

if (UO.Items[myItemId].GetDistance(UO.Me) < 2)
if (UO.Items[myItemId].Exists)

JakubLinhart avatar Feb 15 '18 23:02 JakubLinhart

FirstOrDefault has to support the null pattern as well.

JakubLinhart avatar Feb 18 '18 13:02 JakubLinhart