Some actions fail with "invalid_operator_args" even when some of the arguments were correct, resulting in all arguments being trashed.
Twisted-Code opened this issue ยท 3 comments
Modloader
Fabric
Minecraft version
Minecraft 1.20.1
Hex Casting version
0.11.1-7-pre-620
Modloader version
Fabric: 0.1|.6 + API 0.91.0+ 1.20.1
Modpack info
https://github.com/walksanatora/HexxyTestPack
The latest.log file
Issue description
Expected behavior:
If some of the arguments to an action are the correct type, but not all of them, keep the correctly typed arguments and throw a mishap indicating the first invalid argument's position and the expected type for it
actual behavior:
It mishaps, as expected, but in the process it trashes all the arguments, not just the ones that were invalid.
Hypothesis: invalid_operator_args is too general, and a more specific mishap which trashes only the invalid arguments should be used instead.
For example, here, I've got list, type, num
and have drawn (but not added//applied) Surgeon's Exaltation. The first argument is the right type, the second is wrong (it should be a number) and the third is in the wrong position, but technically would qualify as "any".
The expectation is for it to keep at least the list (since that's below the lowest index that's "wrong") and probably the number (even though it's not where I meant to be). Instead I get lots of hot garbage.
(I've already reported the undefined key in the error message, in #616, this issue is just about the imprecision/aggressiveness of this mishap)
Steps to reproduce
- Open your casting grid
- create a list, null, and a number (preferably in range)
- Surgeon's Exaltation
- As expected, it mishaps. However, it also trashes arguments that should be valid because the mishap is not specific enough.
Other information
The included log is not from the same session depicted in the screenshots, but the general process to cause it both times was the same.
I can test tomorrow if I remember, but I think it used to preserve any arguments that were the right type. Hence my reporting this, I don't ever remember it trashing all arguments in the past. But I could be wrong!
As I suspected, it does not do this on 1.19.2. As tested with HexxyCraft, with a debug media cube in my inventory (BTW, that's another thing that needs to be fixed in 1.20: the debug media cube doesn't seem to be working for me), the following patterns and mishaps occurred:
and it only trashed the middle Iota, since it got a list and "any" for the other two