Bitflag not coming as true? c++

Hello all! I’ve been stuck at this for a while! I’ve tried following this following post: C++ bitmask enums appear to be offset by 1 - Programming & Scripting - Unreal Engine Forums but to my avail, there is no luck! I cant seem to figure this out… anyway, to the problem. Im trying to make an bitflag enum that holds all of my basic movement functions for multiplayer (dedicated server) such as none, sprint, attack, dodge, etc.
Here is the code :

 #define TEST_BIT(Bitmask, Bit) (((Bitmask) & (1 << static_cast<uint8>(Bit))) > 0)
#define SET_BIT(Bitmask, Bit) (Bitmask |= 1 << static_cast<uint8>(Bit))
#define CLEAR_BIT(Bitmask, Bit) (Bitmask &= ~(1 << static_cast<uint8>(Bit)))
#define TOFLAG(Enum) (1 << static_cast<uint8>(Enum))


UENUM(BlueprintType, meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true"))
enum class EMovementCallFlags : uint8

{
    None = 0,
    Sprinting = 1,
    Attacking = 2,
    Blocking = 4,
    Dodging = 8
};

Note: I’ve removed the constant uints re-added them, removed the none, over and over and still the problem persists.

So far, im starting out with sprint because it shouldve been the easiest to do. In my input bindings, i have a start sprint and stop sprint that clears flags as follows :

void APlayerCharacter::StartSprint()
{
        if (ControllerRef != nullptr){
            SET_BIT(ControllerRef->MovementCallFlags,bSprinting);
    }
}

void APlayerCharacter::StopSprint()
{
        if (ControllerRef != nullptr ){
    
        CLEAR_BIT(ControllerRef->MovementCallFlags, bSprinting);
    }

}

So in my move forward and move right functions, i have as follows :

void APlayerCharacter::MoveForward(float Value)
{
    // find out which way is forward
    const FRotator Rotation = Controller->GetControlRotation();
    const FRotator YawRotation(0, Rotation.Yaw, 0);
    
    // get forward vector
    const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
    AddMovementInput(Direction, Value);
    if (TEST_BIT(ControllerRef->MovementCallFlags, bSprinting) != static_cast<uint8>(EMovementCallFlags::None)){
            GetCharacterMovement()->MaxWalkSpeed = attributes.RunSpeed;
    
    }
    else  {
   GetCharacterMovement()->MaxWalkSpeed = attributes.WalkSpeed;
        }
    }


void APlayerCharacter::MoveRight(float Value)
{
    // find out which way is right
    const FRotator Rotation = Controller->GetControlRotation();
    const FRotator YawRotation(0, Rotation.Yaw, 0);
    
    // get right vector
    const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
    // add movement in that direction
    AddMovementInput(Direction, Value);

    if (TEST_BIT(ControllerRef->MovementCallFlags, bSprinting) != static_cast<uint8>(EMovementCallFlags::None)){
    
            GetCharacterMovement()->MaxWalkSpeed = attributes.RunSpeed;

   }
    else  {

        GetCharacterMovement()->MaxWalkSpeed = attributes.WalkSpeed;

    }
}

The problem is that when i hit shift to sprint, my character tries to sprint but the server is holding it back. On top of that there is ControllerRef->MovementCallFlags because I have a uint8 movementcallflags in my custom player controller because originally i had a DoAction function that was going to deal with all this and i’d just share the player controller with everyone on the server so everybody had the same controls BUT then i decided to change that because i thought the problem was in the controller and not the character. The problem still persisted and now im stuck… please. any help is appreciated. I want to learn how to use bitflag enums and I thought i had it but i guess not :frowning:

Anyone out there ? :frowning: