General - Convert vehicle to objectParent
When merged this pull request will:
- Converts
vehicle _unit == unitintoisNull objectParent _unit, it's better and already used in some areas.
What do you mean with it's better? It decreases readability which is why we didn't do this in the past. Performance gains are negligible.
There's also _unit in _unit which is of similar performance and still quite readable IMO.
imo they're all not that readable. I remember vehicle _unit == _unit being confusing as I was just getting into arma.
imo _unit in _unit is the least clear. vehicle _unit == _unit at least has the vehicle command to make its purpose a bit clearer. I am fairly indifferent between vehicle and objectParent, but if I had to pick I'd go with objectParent, more explicit in its return and for someone less familiar, they'll be more likely to google it and get an actual idea of what's going on. vehicle _unit returning _unit on foot instead of objNull is not clear
Use objectParent instead of vehicle to get a soldier's vehicle. Apart from being faster it is also more reliable, as when used on dead crew, vehicle command may surprisingly return the unit itself.
I don't think that's too relevant to the code being changed here, I don't think we'll ever be in a situation where we're calling it on dead crew
I prefer objectParent for reasons above.
I prefer
objectParentfor reasons above.
Same.