Skip to content

Commit

Permalink
Merge pull request #1669 from LinkIsGrim/player-events-new-unit-getters
Browse files Browse the repository at this point in the history
Events - Update player event loop to use new UAV AI getter
  • Loading branch information
PabstMirror authored Jul 28, 2024
2 parents d0d45e0 + 35f4a92 commit cb74759
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions addons/events/fnc_playerEvent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,14 @@ SCRIPT(playerEvent);
private _unit = missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player];
private _vehicle = vehicle _unit;

private _controlledEntity = _unit;
if (!isNull getConnectedUAV _unit) then {
private _uavControl = UAVControl getConnectedUAV _unit;
_uavControl = _uavControl param [(_uavControl find _unit) + 1, ""]; // Will be position STRING if actively controlling, or OBJECT if not.
if (_uavControl isEqualTo "DRIVER") exitWith {
_controlledEntity = driver getConnectedUAV _unit;
};

if (_uavControl isEqualTo "GUNNER") exitWith {
_controlledEntity = gunner getConnectedUAV _unit;
};
};

// Unlike CBA_fnc_turretPath, this will return [-1] when player is driver
private _turret = _vehicle unitTurret _unit;

private _state = [
_unit, group _unit, leader _unit,
currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit,
getUnitLoadout _unit, _vehicle, _turret, _vehicle currentWeaponTurret _turret,
currentVisionMode _controlledEntity, cameraView
currentVisionMode focusOn, cameraView
];

if (_state isNotEqualTo GVAR(oldState)) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/main/script_mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD

// MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 2.14
#define REQUIRED_VERSION 2.16

/*
// Defined DEBUG_MODE_NORMAL in a few CBA_fncs to prevent looped logging :)
Expand Down

0 comments on commit cb74759

Please sign in to comment.