For my player_movement, I use multiply flags.
pXent_setbodyflag(me, NX_BF_FROZEN_ROLL | NX_BF_FROZEN_TILT, 1);
and
pXent_setbodyflag (my, NX_BF_DISABLE_GRAVITY | NX_BF_FROZEN_ROT,1);
If the players movement_state is 0, the player should not be able to tilt or roll.
If the players my.movement_state is 1, the player should not be able to tilt, roll, pan or to use gravity.
movement_state 0:
if (my.movement_state == 0)
{
pXent_setbodyflag(my, NX_BF_FROZEN_ROLL | NX_BF_FROZEN_TILT, 1);
}
movement_state 1:
if (my.movement_state == 1)
{
pXent_setbodyflag (my, NX_BF_DISABLE_GRAVITY | NX_BF_FROZEN_ROLL | NX_BF_FROZEN_TILT | NX_BF_FROZEN_ROT,1);
}
The problem is, when I switch the movement_states the pXent_setbodyflags only add etch other.
Which means, when the player at the beginning the movement_state 0 has, but switches to movement state 1, will the player lose the ability to rot or have gravity, which the player should have in movement state 0!
Any ideas how I can set the flags right, so that the flags from the flags from movement_state 1 doesn't count for movement_state 0 and the same in reverse?