Bug - NAND with 3+ inputs gives incorrect result

C:\Program Files\Epic Games\UE_5.5\Engine\Source\Runtime\Engine\Classes\Kismet\KismetMathLibrary.inl

lines 39-43

KISMET_MATH_FORCEINLINE
bool UKismetMathLibrary::BooleanNAND(bool A, bool B)
{
	return !(A && B);
}

maybe change the BooleanNAND on source to something like this? to allow more than 2 inputs?

KISMET_MATH_FORCEINLINE
bool UKismetMathLibrary::BooleanNAND(const TArray<bool>& Inputs)
{
    for (bool Input : Inputs)
    {
        if (!Input)
        {
            return true; // If any input is false, return true (NAND logic).
        }
    }
    return false; // If all inputs are true, return false.
}

EDIT:
the blueprint comment does say “returns the logical NAND of two values”


so is the real bug that there is a “add pin” + on the node?

EDIT2:
i did not test, but: all the kismet library boolean functions have only 2 inputs, so it is very possible that when there is more than 2 inputs on other boolean blueprint nodes, they might be bugged aswell.

1 Like