-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBA_fnc_currentUnit report UAV entity when controlling UAV #1005
Changes from all commits
4419fbf
3dacd83
1cb1374
101edb5
050baf1
02101fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,13 +129,16 @@ if (_id != -1) then { | |
GVAR(oldCameraView) = ""; | ||
GVAR(oldFeatureCamera) = ""; | ||
GVAR(oldVisibleMap) = false; | ||
GVAR(oldUAVControl) = []; | ||
GVAR(controlledEntity) = objNull; | ||
|
||
GVAR(playerEHInfo) pushBack addMissionEventHandler ["EachFrame", {call FUNC(playerEH_EachFrame)}]; | ||
[QFUNC(playerEH_EachFrame), { | ||
private _player = call CBA_fnc_currentUnit; | ||
private _player = missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player]; | ||
if !(_player isEqualTo GVAR(oldUnit)) then { | ||
[QGVAR(unitEvent), [_player, GVAR(oldUnit)]] call CBA_fnc_localEvent; | ||
GVAR(oldUnit) = _player; | ||
GVAR(oldUAVControl) = []; // force update | ||
}; | ||
|
||
private _data = group _player; | ||
|
@@ -189,7 +192,24 @@ if (_id != -1) then { | |
[QGVAR(turretEvent), [_player, _data]] call CBA_fnc_localEvent; | ||
}; | ||
|
||
_data = currentVisionMode _player; | ||
// handle controlling UAV, UAV entity needed for visionMode | ||
_data = UAVControl getConnectedUAV _player; | ||
if !(_data isEqualTo GVAR(oldUAVControl)) then { | ||
GVAR(oldUAVControl) = _data; | ||
|
||
private _role = _data param [(_data find _player) + 1, ""]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the wiki page wrong? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Always. Drone with turret + driver/pilot looks like this: |
||
if (_role isEqualTo "DRIVER") exitWith { | ||
GVAR(controlledEntity) = driver getConnectedUAV _player; | ||
}; | ||
|
||
if (_role isEqualTo "GUNNER") exitWith { | ||
GVAR(controlledEntity) = gunner getConnectedUAV _player; | ||
}; | ||
|
||
GVAR(controlledEntity) = _player; | ||
}; | ||
|
||
_data = currentVisionMode GVAR(controlledEntity); | ||
if !(_data isEqualTo GVAR(oldVisionMode)) then { | ||
GVAR(oldVisionMode) = _data; | ||
[QGVAR(visionModeEvent), [_player, _data]] call CBA_fnc_localEvent; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change still necessary? I mean.. I like the performance gain..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it just to compensate for the loss due to this.