Page 1 of 1

[1.0.0] util.moveposition only works with array-like positions

Posted: Mon Sep 07, 2020 1:38 am
by sparr
https://github.com/wube/factorio-data/b ... #L114-L131

This function only works with positions that look like {5,1}, not the kind that look like {x=5,y=1} which come from the API.

I've written a version that honors both types of positions, and also supports the diagonal defined directions, if that would be helpful.

Re: [1.0.0] util.moveposition only works with array-like positions

Posted: Thu Sep 10, 2020 4:50 pm
by Klonan
Its not a bug, it was never specified that it would work as you describe

Re: [1.0.0] util.moveposition only works with array-like positions

Posted: Thu Sep 10, 2020 5:00 pm
by sparr
It's weird for a function in the core library to call something a "position" but not work with the Position type that the rest of the API returns.