1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Fix activating every frame when action is bound to a trigger

This commit is contained in:
Digmaster 2015-01-19 18:20:49 -06:00 committed by scrawl
parent e3e6190b85
commit 796b4b01b0

View file

@ -233,14 +233,26 @@ namespace MWInput
int action = channel->getNumber(); int action = channel->getNumber();
if(currentValue > .8) currentValue = 1.0; if((previousValue == 1 || previousValue == 0) && (currentValue==1 || currentValue==0))
else if(currentValue < .6) currentValue = 0.0; {
else return; //Is a normal button press, so don't change it at all
}
if(previousValue > .8) previousValue = 1.0; //Otherwise only trigger button presses as they go through specific points
else if(previousValue < .6) previousValue = 0.0; else if(previousValue >= .8 && currentValue < .8)
{
if(currentValue == previousValue) return; currentValue = 0.0;
previousValue = 1.0;
}
else if(previousValue <= .6 && currentValue > .6)
{
currentValue = 1.0;
previousValue = 0.0;
}
else
{
//If it's not switching between those values, ignore the channel change.
return;
}
if (mControlSwitch["playercontrols"]) if (mControlSwitch["playercontrols"])
{ {
@ -271,7 +283,6 @@ namespace MWInput
break; break;
case A_Activate: case A_Activate:
resetIdleTime(); resetIdleTime();
if (!MWBase::Environment::get().getWindowManager()->isGuiMode()) if (!MWBase::Environment::get().getWindowManager()->isGuiMode())
activate(); activate();
break; break;