Hello,
Today I discovered the IncrementInt, IncrementFloat, DecrementInt and DecrementFloat in the standard macros library. However, I have discovered a few bugs in them:
- All the result pins in these functions are connected to the output of the operator like this:
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:
- 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!