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

getPos is a brittle function #187

Closed
SilentSpike opened this Issue Oct 27, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@SilentSpike
Contributor

SilentSpike commented Oct 27, 2015

Same deal as fix #183 for #182.

CBA_fnc_getPos uses brittle code that can't handle input in array form because it deals directly with variable _this, however it's a bit more problematic to fix and retain backwards compatibility since the parameters passed can be an array of the form [x,y,z].

@MikeMatrix

This comment has been minimized.

Show comment
Hide comment
@MikeMatrix

MikeMatrix Oct 28, 2015

Contributor

params ["_x", "_y", "_z"] and then check if _x is array, if so, then _x params ["_x", "_y", "_z"] as a potential solution? (didn't check if this code is viable at all)

Contributor

MikeMatrix commented Oct 28, 2015

params ["_x", "_y", "_z"] and then check if _x is array, if so, then _x params ["_x", "_y", "_z"] as a potential solution? (didn't check if this code is viable at all)

@Killswitch00

This comment has been minimized.

Show comment
Hide comment
@Killswitch00

Killswitch00 Oct 30, 2015

Contributor

Please unbrittle it and submit a PR :-)

Contributor

Killswitch00 commented Oct 30, 2015

Please unbrittle it and submit a PR :-)

@SilentSpike

This comment has been minimized.

Show comment
Hide comment
@SilentSpike

SilentSpike Oct 31, 2015

Contributor

Internally debating whether it's worth it 😄

Just reported for tracking purposes. If you guys think it shouldn't be then I'll go ahead and fix it

Contributor

SilentSpike commented Oct 31, 2015

Internally debating whether it's worth it 😄

Just reported for tracking purposes. If you guys think it shouldn't be then I'll go ahead and fix it

@commy2

This comment has been minimized.

Show comment
Hide comment
@commy2

commy2 Nov 15, 2015

Contributor

Why would someone do:
[[x,y,z]] call CBA_fnc_getPos?

I guess the description states that Marker, Object, Location, Group or Position are supported (but not Task apparently) but that doesn't really make sense to me.

Contributor

commy2 commented Nov 15, 2015

Why would someone do:
[[x,y,z]] call CBA_fnc_getPos?

I guess the description states that Marker, Object, Location, Group or Position are supported (but not Task apparently) but that doesn't really make sense to me.

@SilentSpike

This comment has been minimized.

Show comment
Hide comment
@SilentSpike

SilentSpike Nov 15, 2015

Contributor

^ Commy's changes do fix it, a good solution 👍

Contributor

SilentSpike commented Nov 15, 2015

^ Commy's changes do fix it, a good solution 👍

@commy2 commy2 closed this in e3a32b4 Nov 16, 2015

Killswitch00 added a commit that referenced this issue Nov 16, 2015

Merge pull request #196 from CBATeam/paramsgetpos
'unbrittle' CBA_fnc_getPos, close #187

@Killswitch00 Killswitch00 added this to the 2.2 milestone Nov 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment