Bugs in IncrementInt, IncrementFloat, DecrementInt and DecrementFloat

Hello,

Today I discovered the IncrementInt, IncrementFloat, DecrementInt and DecrementFloat in the standard macros library. However, I have discovered a few bugs in them:

  1. All the result pins in these functions are connected to the output of the operator like this:

51342-probl1.png

This works fine if you feed in a literal float, but if you try and Increment or Decrement a member variable it goes wrong. When evaluating the result, it reads the input reference again (which has already been incremented) then adds 1 and returns it. Hence, 1++ ends up setting the referenced variable to 2, but returning 3. This bug is present in all of the macros. I think the fix should be:

  1. Secondly, DecrementInt is trying to decrement zero and hence doesn’t do anything.

Finally and less importantly, I was looking for something like this for a while, it would be great if they showed up when I searched for ++ or --. I would have found them much earlier.

Thanks!

Hello Vealy,

I was able to reproduce the issues that you have mentioned on our end. After a bit of digging I found that the second issue in a known issue (UE-15560) and that it has been resolved internally. The current work around is to simply replace the 0 with a 1 and this will update the macros from then on. I have also written up a report ( UE-19128) for the first issue that was mentioned. As for the third section of your post, I have written up a request ( UE-19129) as well. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Make it a great day