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

Improve debugging experience #88

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ if (isServer) then {
[QGVAR(playMusicServer), {
_this call FUNC(playMusicServer);
}] call CBA_fnc_addEventHandler;

// Log side chat messages to RPT for easier troubleshooting
[QGVAR(showSideChatMsg), {
params [["_side", sideEmpty], ["_msg", ""]];
if (_msg isEqualTo "") exitWith {};
private _sideText = if (_side isEqualTo sideEmpty) then { "ALL" } else { _side };
INFO_2("(Side Chat) %1: %2",_sideText,_msg);
}] call CBA_fnc_addEventHandler;
};

[QGVAR(showMessage), {
Expand Down
6 changes: 5 additions & 1 deletion addons/common/functions/fnc_getNearestLocation.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ if (_pos isEqualType objNull) then {

// Get nearest locations to object.
private _locations = nearestLocations [_pos, GVAR(allLocationTypes), _searchRadius];
diag_log format ["[AFSK] [COMMON] [getNearestLocation] Pos: %1, Location: %2", _pos, _locations param [0, locationNull]];

// Introduced so that there are no issues with ',' in TRACE macro.
#define GET_NEAREST_LOCATION _locations param [0, locationNull]
TRACE_2("(getNearestLocation) Pos: %1 Location: %2", _pos, GET_NEAREST_LOCATION);

// Select nearest location from array.
_locations param [0, locationNull]
4 changes: 4 additions & 0 deletions addons/main/script_mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
#else
#define LINKFUNC(x) FUNC(x)
#endif

// Enables some debugging functionality.
// Should never be enabled during normal gameplay as it might reveal information!
// #define DEV_DEBUG
7 changes: 7 additions & 0 deletions addons/markers/functions/fnc_loop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
_marker = [_civilian] call FUNC(createCivilianMarker);
} else {
_marker setMarkerPosLocal (position _civilian);
#ifdef DEV_DEBUG
if (vehicle _civilian isEqualTo _civilian) then {
_marker setMarkerColorLocal "ColorGreen";
} else {
_marker setMarkerColorLocal "ColorUnknown";
};
#endif
};
} foreach EGVAR(civilian,civilians);

Expand Down