Krystoh
(Krystoh)
August 27, 2024, 5:27pm
1
Hello everyone,
I have an array of floats called “Money Possessed Given” that will match with a map variable called “Enum Money Map” in order to spawn blueprints with a certain enum value.
My problem is that each time I use “Max Float Array” in order to sort the array.
My enum returning null value for each float under 1.
However if I don’t use “Max Float Array”, enum will work properly.
So is there something I’m doing wrong?
Is there any good way so sorte arrays maybe?
Thanks a lot for help!
GabUECV
(GabUECV)
August 27, 2024, 6:57pm
2
Have you tried to simply use the sort function ?
Though, in general I’d be super cautious with maps of “floats to something”, because float equality is not really what you may think it is
Krystoh
(Krystoh)
August 27, 2024, 7:23pm
5
@GabUECV thanks for your answer, however how did you found this function please?
I’m not able to find it, actually using 5.1.
GabUECV
(GabUECV)
August 27, 2024, 7:24pm
6
Actually I am on 5.4, probably it have been added in between ? I don’t know really
Krystoh
(Krystoh)
August 27, 2024, 7:29pm
7
Oh well maybe that’s it haha
GabUECV
(GabUECV)
August 30, 2024, 10:54am
8
I double checked in the release notes: it have been added in the 5.4
In the 5.4 release notes:
Add blueprint array sort functions for native types. Adds in-place sort functions. Supports options for stable sort and ascending/descending.
1 Like
Krystoh
(Krystoh)
August 30, 2024, 12:38pm
9
Thank you then, I’ve just 5 minutes ago pushed my project to 5.4 (not just for that, but other reasons). So after I fixed many visual troubles, I’ll take a look at this and answer here if the problem is solved or not.
1 Like