Merge pull request #937 from acemod/fcsMuzzleVelocityCorrection

Takes negative initSpeed values into account
This commit is contained in:
ulteq 2015-05-01 12:24:22 +02:00
commit a9cde188ea

View File

@ -44,9 +44,11 @@ _offset = 0;
} forEach _FCSMagazines; } forEach _FCSMagazines;
// Correct velocity for weapons that have initVelocity // Correct velocity for weapons that have initVelocity
// @todo: Take into account negative initVelocities _velocityCorrection = if (getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed") > 0) then {
_velocityCorrection = (vectorMagnitude velocity _projectile) - (vectorMagnitude velocity _projectile) - getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed")
getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); } else {
0
};
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, -_velocityCorrection] call EFUNC(common,changeProjectileDirection); [_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, -_velocityCorrection] call EFUNC(common,changeProjectileDirection);