Pressing sprint doesn't stop anymore from using tool / weapon

Pressing sprint key used to prevent using tool/weapon. Now sprint key
must be pressed together with movement keys (while not crouching) to
prevent you from using tool/weapon.
This commit is contained in:
Chameleonhider 2016-02-11 10:43:55 +02:00
parent 83b061fedf
commit 39a7c74fa6
2 changed files with 3 additions and 12 deletions

View File

@ -377,11 +377,6 @@ namespace spades {
playerInput.crouch = down;
}else if(CheckKey(cg_keySprint, name)){
playerInput.sprint = down;
if(down){
if(world->GetLocalPlayer()->IsToolWeapon()){
weapInput.secondary = false;
}
}
}else if(CheckKey(cg_keySneak, name)){
playerInput.sneak = down;
}else if(CheckKey(cg_keyJump, name)){
@ -394,15 +389,11 @@ namespace spades {
}else if(CheckKey(cg_keyAltAttack, name)){
auto lastVal = weapInput.secondary;
if(world->GetLocalPlayer()->IsToolWeapon() && (!cg_holdAimDownSight)){
if(down && !playerInput.sprint && !world->GetLocalPlayer()->GetWeapon()->IsReloading()){
if(down && !world->GetLocalPlayer()->GetWeapon()->IsReloading()){
weapInput.secondary = !weapInput.secondary;
}
}else{
if(!playerInput.sprint){
weapInput.secondary = down;
}else{
weapInput.secondary = down;
}
}
if(world->GetLocalPlayer()->IsToolWeapon() && weapInput.secondary && !lastVal &&
world->GetLocalPlayer()->IsReadyToUseTool() &&

View File

@ -119,7 +119,7 @@ namespace spades {
if(!IsAlive())
return;
if(input.sprint){
if(input.sprint && !input.crouch && (input.moveBackward || input.moveForward || input.moveLeft || input.moveRight)){
newInput.primary = false;
newInput.secondary = false;
}