Skip to content

Commit

Permalink
Find rope start position more efficiently
Browse files Browse the repository at this point in the history
By fully using the passed parameters instead of fetching it from config again
  • Loading branch information
mrschick committed Nov 2, 2023
1 parent 85de994 commit 2d4cd0e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions addons/sys_intercom/fnc_infantryPhoneChildrenActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Public: No
*/

params ["_target"];
params ["_target", "_unit", "_position"];

private _actions = [];

Expand Down Expand Up @@ -47,17 +47,6 @@ if (_target isKindOf "CAManBase") then {
} else {
if (vehicle acre_player != _target) then {
// Pointing at a vehicle. Get or return the infantry telephone

// Get Infantry phone position (copied fnc_infantryPhoneAction.sqf, probably a better way to pass position info)
private _positionConfig = configFile >> "CfgVehicles" >> (typeOf _target) >> "acre_infantryPhonePosition";
private _position = [0, 0, 0]; // Default to main action point
if (isText _positionConfig) then {
_position = _target selectionPosition (getText _positionConfig); // Convert to coordinates for sys_core intercomPFH checks
};
if (isArray _positionConfig) then {
_position = getArray _positionConfig;
};

if (isNull _vehicleInfantryPhone) then {
{
private _action = [
Expand Down

0 comments on commit 2d4cd0e

Please sign in to comment.