Random PSIdeas

Random PSIdeas

1M Downloads

Vector Fallback doesn't work (as advertised?)

ItsTheKais opened this issue ยท 2 comments

commented

Debug spell demonstrating the issue:

{spellName:"Vector Fallback Test",uuidMost:-5490965429439347113L,validSpell:1b,spellList:[{data:{key:"selectorCaster"},x:0,y:0},{data:{params:{_target:1},key:"operatorEntityLook"},x:0,y:1},{data:{params:{_target:3},key:"operatorEntityPosition"},x:1,y:0},{data:{params:{_ray:3,_max:2,_position:1},key:"operatorVectorRaycast"},x:1,y:1},{data:{key:"constantNumber",constantValue:"31"},x:1,y:2},{data:{params:{_target:3},key:"connector"},x:2,y:0},{data:{params:{rpsideas.spellparam.fallback:1,_target:3},key:"rpsideas.vector_fallback"},x:2,y:1},{data:{params:{_number:0,_target:1},key:"trickDebug"},x:2,y:2}],uuidLeast:-4760017982556439727L}

Assuming my understanding of how Vector Fallback works is correct, this spell should print out the location of the block the caster is looking at, or print out the caster's location if they are not looking at a block within raycast range.

What actually happens is, the spell works if the raycast succeeds, but throws the "vector is nonexistant or null" error at [2, 2] (the position of the raycast) if no block is within range, which is the exact error Vector Fallback claims to catch.

If Vector Fallback is supposed to do what I've assumed it should do, then it's broken.

If Vector Fallback is not supposed to do what I've assumed it should do, then its description and/or settings should probably be rewritten.

commented

Weird issue, I'll take a gander at it when I get home.
The way vector fallback is supposed to work is you pass it two vectors one 'main' vector and a fallback one. If the 'main' vector is null or zero it should return the fallback one. Otherwise it returns the other one

commented

For now it's not possible to override errors with a spell piece. I'm going to suggest a similar feature to Vazkii, if ends up adding it I'll rewrite vector fallback. For now I'll just update the description saying that it doesn't work on errors