Hello!
Im seat on 2019.4.20f
I found in unity that the expression not work:
if ( (otherSlot.EquipmentSlot ==true && this.item.itemType == Item.ItemType.item) || ( this.item == null) || (otherSlot.EquipmentSlot == false))
But the expression, works:
if ((this.item == null) || (otherSlot.EquipmentSlot == true && this.item.itemType == Item.ItemType.item) || (otherSlot.EquipmentSlot == false))
Is it bug, or a feature?
According to my logic, I think this is because there is a null. (And the null operation should be important with high priority, right?)
Tell me who is understands for unity logic, because in my opinion everything looks like a permutation of the places of the terms, in which the sum does not change. In any case, it should not change… isnt it? But it turns out that unity gets stuck in the “otherSlot.EquipmentSlot == true” condition and does not check other conditions. That is, there is also the concept of “priority of operations” because of which the program produces an incorrect result. Am I missing something, or is this a mistake in unity? Found this with BAI.AI, and then work in my project.
With best regards.