mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
5ae0ef6bbe
* Fix explosive placement while underwater * Apply suggestions from code review Co-Authored-By: alganthe <alganthe@live.fr> * Change placeApprove header to reflect changes * Replace lineIntersectsWith in isInMedicalFacility * Replace linesIntersects in isInRepairFacility, fix params Public func, params should have an expected type. * Replace linesIntersects in spallTrack * Replace lineIntersects in getFirstObjectIntersection and findReflection * Replace lineIntersects in advanced throwing grenades can pass glass underwater now, I bet all of 0 person will be glad that horrendous bug is now fixed. * Fix possible issue in pointing while underwater * Fix possible issue while underwater in attach * Replace count with isEqualTo in lineIntersectsSurfaces replacements * Fix inverted conditions * Fix drawArc * Fix fnc_attach * Reverse advanced_throwing and spallTrack lineIntersects changes * Fix issues raised from code review
32 lines
718 B
Plaintext
32 lines
718 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Ruthberg
|
|
* Returns the the first intersection with terrain between two positions.
|
|
*
|
|
* Arguments:
|
|
* 0: PositionASL <ARRAY>
|
|
* 1: PositionATL <ARRAY>
|
|
* 2: Accuracy <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* 0: Intersects <BOOL>
|
|
* 1: Intersection Position ASL <ARRAY>
|
|
*
|
|
* Example:
|
|
* [[1,2,3], [0,0,5], 5] call ace_common_fnc_getFirstObjectIntersection
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params ["_source", "_destination"];
|
|
|
|
private _result = [false, [0, 0, 0]];
|
|
private _hits = lineIntersectsSurfaces [_source, _destination, objNull, objNull, true, -1];
|
|
{
|
|
_x params ["_pos", "", "_obj"];
|
|
if (!isNull _obj) exitWith {
|
|
_result = [true, _pos];
|
|
};
|
|
} forEach _hits;
|
|
_result
|