forked from teamnwah/openmw-tes3coop
Cleaned up inputmanager, tightened up player.exectueAutoMove()
This commit is contained in:
parent
1bc9a46c6b
commit
962b8c9781
2 changed files with 15 additions and 35 deletions
|
@ -281,7 +281,7 @@ namespace MWInput
|
|||
if(windows.isGuiMode()) return true;
|
||||
|
||||
float speed = 300 * evt.timeSinceLastFrame; //placeholder player speed?
|
||||
float TESTwalkSpeed = 100 * evt.timeSinceLastFrame; //How about another?
|
||||
//float TESTwalkSpeed = 100 * evt.timeSinceLastFrame; //How about another?
|
||||
|
||||
float moveX = 0, moveY = 0, moveZ = 0;
|
||||
|
||||
|
@ -291,51 +291,28 @@ namespace MWInput
|
|||
//Poll and execute movement keys - will disable automove if pressed.
|
||||
if(poller.isDown(A_MoveLeft))
|
||||
{
|
||||
if (player.getmisWalking() == false)
|
||||
{
|
||||
player.setmAutoMove(false);
|
||||
moveX -= speed;
|
||||
} else {
|
||||
player.setmAutoMove(false);
|
||||
moveX -= TESTwalkSpeed;
|
||||
}
|
||||
player.setmAutoMove(false);
|
||||
moveX -= speed;
|
||||
|
||||
}
|
||||
|
||||
if(poller.isDown(A_MoveRight))
|
||||
{
|
||||
if (player.getmisWalking() == false)
|
||||
{
|
||||
player.setmAutoMove(false);
|
||||
moveX += speed;
|
||||
} else {
|
||||
player.setmAutoMove(false);
|
||||
moveX += TESTwalkSpeed;
|
||||
}
|
||||
player.setmAutoMove(false);
|
||||
moveX += speed;
|
||||
}
|
||||
|
||||
if(poller.isDown(A_MoveForward))
|
||||
{
|
||||
if (player.getmisWalking() == false)
|
||||
{
|
||||
player.setmAutoMove(false);
|
||||
moveZ -= speed;
|
||||
} else {
|
||||
player.setmAutoMove(false);
|
||||
moveZ -= TESTwalkSpeed;
|
||||
player.setmAutoMove(false);
|
||||
moveZ -= speed;
|
||||
}
|
||||
}
|
||||
|
||||
if(poller.isDown(A_MoveBackward))
|
||||
{
|
||||
if (player.getmisWalking() == false)
|
||||
{
|
||||
player.setmAutoMove(false);
|
||||
moveZ += speed;
|
||||
} else {
|
||||
player.setmAutoMove(false);
|
||||
moveZ += TESTwalkSpeed;
|
||||
}
|
||||
}
|
||||
player.setmAutoMove(false);
|
||||
moveZ += speed;
|
||||
}
|
||||
|
||||
|
||||
// TODO: These should be enabled for floating modes (like
|
||||
|
|
|
@ -126,11 +126,14 @@ namespace MWWorld
|
|||
/// <param name="duration">float value representing time since last call</param>
|
||||
void executeAutoMove(float duration)
|
||||
{
|
||||
float X_Val = 0.0f;
|
||||
float Y_Val = 0.0f;
|
||||
float Z_Val = 300.0f * duration * -1.0f;
|
||||
if (mAutoMove == true)
|
||||
{
|
||||
//if player is running
|
||||
//Make player go at full speed
|
||||
//player.moveRel(0, 0, (300*duration*-1));
|
||||
moveRel(X_Val, Y_Val, Z_Val);
|
||||
//else go forward at walk speed.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue