Interaction - Fix div0 error in getVehiclePos (#6139)

* Interaction - Fix div0 error in getVehiclePos

* Formating
This commit is contained in:
PabstMirror 2018-02-09 21:45:21 -06:00 committed by GitHub
parent c864a6d569
commit 1c6c7914dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -26,9 +26,10 @@ private _relPos = _target worldToModelVisual ASLToAGL _cameraPosASL;
#endif
_relPos params ["_dx", "_dy", "_dz"];
private _ndx = (abs _dx) / ((abs (_bbx)) - 1);
private _ndy = (abs _dy) / ((abs (_bbY)) - 1);
private _ndz = (abs _dz) / ((abs (_bbZ)) - 1);
private _ndx = (abs _dx) / (((abs (_bbX)) - 1) max 1);
private _ndy = (abs _dy) / (((abs (_bbY)) - 1) max 1);
private _ndz = (abs _dz) / (((abs (_bbZ)) - 1) max 1);
private _pos = [];
if (_ndx > _ndy) then {

View File

@ -29,9 +29,9 @@ if (isNumber (_config >> QGVAR(bodyLength))) then {_bbY = getNumber (_config >>
private _relPos = _target worldToModelVisual ASLToAGL _cameraPosASL;
_relPos params ["_dx", "_dy", "_dz"];
private _ndx = (abs _dx) / ((abs (_bbx)) - 1);
private _ndy = (abs _dy) / ((abs (_bbY)) - 1);
private _ndz = (abs _dz) / ((abs (_bbZ)) - 1);
private _ndx = (abs _dx) / (((abs (_bbX)) - 1) max 1);
private _ndy = (abs _dy) / (((abs (_bbY)) - 1) max 1);
private _ndz = (abs _dz) / (((abs (_bbZ)) - 1) max 1);
private _pos = [];