Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General - Convert vehicle to objectParent #9801

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Conversation

Mike-MF
Copy link
Member

@Mike-MF Mike-MF commented Feb 20, 2024

When merged this pull request will:

  • Converts vehicle _unit == unit into isNull objectParent _unit, it's better and already used in some areas.

@BaerMitUmlaut
Copy link
Member

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.

@veteran29
Copy link
Member

There's also _unit in _unit which is of similar performance and still quite readable IMO.

@BrettMayson
Copy link
Member

BrettMayson commented Feb 20, 2024

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

@jonpas jonpas added kind/enhancement Release Notes: **IMPROVED:** status/discussion labels Feb 29, 2024
@LinkIsGrim
Copy link
Contributor

I prefer objectParent for reasons above.

@johnb432
Copy link
Contributor

I prefer objectParent for reasons above.

Same.

@jonpas jonpas added this to the 3.17.0 milestone Mar 17, 2024
Copy link
Contributor

@LinkIsGrim LinkIsGrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge conflicts!

@LinkIsGrim LinkIsGrim merged commit cee187a into master Mar 26, 2024
5 checks passed
@LinkIsGrim LinkIsGrim deleted the vehicle-to-objectParent branch March 26, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:** status/discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants