editor camera bugfix

This commit is contained in:
Bukz
2023-06-13 06:09:48 -04:00
parent 45fd36756a
commit eae77fec5c
2 changed files with 3 additions and 2 deletions
+3 -2
View File
@@ -475,11 +475,12 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
if(editfly) // just apply velocity
{
pl->o.add(d);
if(pl->jumpnext && !pl->trycrouch)
Uint8 const* state = SDL_GetKeyboardState(0);
if(pl->jumpnext)
{
pl->vel.z = 0.5f; // fly directly upwards while holding jump keybinds
}
else if (pl->trycrouch && !pl->jumpnext)
else if (state[SDL_SCANCODE_LSHIFT] != 0 || state[SDL_SCANCODE_RSHIFT] != 0)
{
pl->vel.z = -0.5f; // fly directly down while holding crouch keybinds
}