Fixes a recently introduced bug in the relative click memory

This commit is contained in:
ulteq 2015-04-21 16:54:26 +02:00
parent e22a7e1aad
commit 7c57ad25bd

View File

@ -95,9 +95,9 @@ if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])
GVAR(workingMemory) set [1, _muzzleVelocity]; GVAR(workingMemory) set [1, _muzzleVelocity];
GVAR(workingMemory) set [2, _zeroRange]; GVAR(workingMemory) set [2, _zeroRange];
private ["_elevationCur", "_windageCur", "_elevationScopeStep", "_windageScopeStep"]; private ["_elevationCur", "_windageCur", "_clickSize", "_clickNumber", "_clickInterval"];
_elevationCur = parseNumber(ctrlText 402); _elevationCur = GVAR(workingMemory) select 10;
_windageCur = parseNumber(ctrlText 412); _windageCur = GVAR(workingMemory) select 11;
switch (GVAR(currentScopeUnit)) do { switch (GVAR(currentScopeUnit)) do {
case 0: { case 0: {
@ -109,11 +109,16 @@ switch (GVAR(currentScopeUnit)) do {
_windageCur = _windageCur / 1.047; _windageCur = _windageCur / 1.047;
}; };
case 3: { case 3: {
_elevationScopeStep = (GVAR(workingMemory) select 7); switch (GVAR(workingMemory) select 7) do {
_windageScopeStep = (GVAR(workingMemory) select 8); case 0: { _clickSize = 1; };
case 1: { _clickSize = 1 / 1.047; };
case 2: { _clickSize = 3.38; };
};
_clickNumber = GVAR(workingMemory) select 8;
_clickInterval = _clickSize / _clickNumber;
_elevationCur = _elevationCur * _elevationScopeStep; _elevationCur = Round(_elevationCur / _clickInterval);
_windageCur = _windageCur * _windageScopeStep; _windageCur = Round(_windageCur / _clickInterval);
}; };
}; };