Skip to content
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

Prevent Sensor Data to be Requested on Remote Units when Debug Draw is enabled #330

Merged
merged 4 commits into from
Feb 23, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions addons/main/functions/debug/fnc_debugDraw.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -141,28 +141,33 @@ private _posCam = positionCameraToWorld [0, 0, 0];

private _targetKnowledge = [];
private _name = if (_currentTarget isEqualType objNull && {!isNull _currentTarget}) then {
private _knowledge = _unit targetKnowledge _currentTarget;
private _knowledgePosition = ASLtoAGL(_knowledge select 6);
private _knowledgeAge = _knowledge select 2;
if (_knowledge select 2 == time && local _unit) then {
_unit setVariable [QGVAR(debug_LastSeenPos), _knowledgePosition, GVAR(debug_functions)];
};
private _lastSeen = _unit getVariable [QGVAR(debug_LastSeenPos), _knowledgePosition];
_targetKnowledge append [
"<t color='#C7CCC1'>Target Knowledge: <br/>",
" Last Seen: ", _lastSeen, " (", _knowledgeAge toFixed 2, ")<br/>",
" Position Error: ", (_knowledge select 5) toFixed 2, "</t><br/>"
];

drawLine3D [_renderPos, _knowledgePosition, [0, 1, 0, 0.5]];
drawIcon3D ["a3\ui_f\data\Map\Markers\System\dummy_ca.paa", [1, 1, 1, 1], _knowledgePosition, 1, 1, 0, "Estimated Target Position"];

if !(_lastSeen isEqualType "") then {
drawLine3D [_renderPos, _lastSeen, [0, 0, 1, 0.5]];
drawIcon3D ["a3\ui_f\data\Map\Markers\System\dummy_ca.paa", [1, 1, 1, 1], _lastSeen, 1, 1, 0, "Last Seen Position"];
if (!getRemoteSensorsDisabled || local _unit) then {
jokoho48 marked this conversation as resolved.
Show resolved Hide resolved
private _knowledge = _unit targetKnowledge _currentTarget;
private _knowledgePosition = ASLtoAGL(_knowledge select 6);
private _knowledgeAge = _knowledge select 2;
if (_knowledge select 2 == time && local _unit) then {
jokoho48 marked this conversation as resolved.
Show resolved Hide resolved
_unit setVariable [QGVAR(debug_LastSeenPos), _knowledgePosition, GVAR(debug_functions)];
};
private _lastSeen = _unit getVariable [QGVAR(debug_LastSeenPos), _knowledgePosition];
_targetKnowledge append [
"<t color='#C7CCC1'>Target Knowledge: <br/>",
" Last Seen: ", _lastSeen, " (", _knowledgeAge toFixed 2, ")<br/>",
" Position Error: ", (_knowledge select 5) toFixed 2, "</t><br/>"
];

drawLine3D [_renderPos, _knowledgePosition, [0, 1, 0, 0.5]];
drawIcon3D ["a3\ui_f\data\Map\Markers\System\dummy_ca.paa", [1, 1, 1, 1], _knowledgePosition, 1, 1, 0, "Estimated Target Position"];

if !(_lastSeen isEqualType "") then {
drawLine3D [_renderPos, _lastSeen, [0, 0, 1, 0.5]];
drawIcon3D ["a3\ui_f\data\Map\Markers\System\dummy_ca.paa", [1, 1, 1, 1], _lastSeen, 1, 1, 0, "Last Seen Position"];
};
} else {
_targetKnowledge pushBack [
"<t color'#FFAA00'>RemoteSensors Disabled<br/>",
"<t color'#FFAA00'>and Unit Not Local<br/>"
];
};


drawLine3D [_renderPos, getPosATLVisual _currentTarget, [1, 0, 0, 1]];
[name _currentTarget, "None"] select (isNull _currentTarget);
} else {
Expand Down Expand Up @@ -217,7 +222,7 @@ private _posCam = positionCameraToWorld [0, 0, 0];
_textData append ["<t color='#FFAA00'>MOVE disabled</t>", "<br/>"];
};
if (_unit getVariable [QEGVAR(danger,forceMove), false]) then {
_textData append ["<t color='#ff4000'>Forced AI</t>", "<br/>"];
_textData append ["<t color='#FF4000'>Forced AI</t>", "<br/>"];
};
if (fleeing _unit) then {
_textData append ["<t color='#FFC0CB'>Fleeing</t>", "<br/>"];
Expand Down