AdvThrow - Fix toqrue script error for IR strobes (#5842)

Close #5835
- Add config to GrenadeCore (IRStrobeBase: GrenadeCore)
- Verify array is valid 3d vector in throw.sqf
This commit is contained in:
PabstMirror 2017-12-02 12:23:34 -06:00 committed by GitHub
parent a00457ccff
commit d1ba153ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -4,4 +4,8 @@ class CfgAmmo {
GVAR(torqueDirection)[] = {1, 1, 0};
GVAR(torqueMagnitude) = "(50 + random 100) * selectRandom [1, -1]";
};
class GrenadeCore: Default {
GVAR(torqueDirection)[] = {1, 1, 0};
GVAR(torqueMagnitude) = "(50 + random 100) * selectRandom [1, -1]";
};
};

View File

@ -50,7 +50,8 @@ if (!(_unit getVariable [QGVAR(primed), false])) then {
};
private _config = configFile >> "CfgAmmo" >> typeOf _activeThrowable;
private _torqueDir = vectorNormalized (getArray (_config >> QGVAR(torqueDirection)));
private _torqueDir = getArray (_config >> QGVAR(torqueDirection));
_torqueDir = if (_torqueDir isEqualTypeArray [0,0,0]) then { vectorNormalized _torqueDir } else { [0,0,0] };
private _torqueMag = getNumber (_config >> QGVAR(torqueMagnitude));
private _torque = _torqueDir vectorMultiply _torqueMag;