getPos is a brittle function #187

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

Projects

None yet

4 participants

@SilentSpike
Contributor

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
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)

@Killswitch00
Contributor

Please unbrittle it and submit a PR :-)

@SilentSpike
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

@commy2
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
Contributor

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

@commy2 commy2 closed this in e3a32b4 Nov 16, 2015
@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