Skip to content

Commit

Permalink
Merge pull request #525 from CBATeam/make-ERROR_MSG-support-newlines
Browse files Browse the repository at this point in the history
add support for \n to ERROR_MSG()
  • Loading branch information
Killswitch00 authored Oct 11, 2016
2 parents a4ecc39 + 6db7a79 commit caf0ca1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions addons/diagnostic/fnc_error.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ disableSerialization;
QGVAR(Error) cutRsc [QGVAR(Error), "PLAIN"];
private _control = uiNamespace getVariable QGVAR(Error);

if (_message isEqualTo "") then {
_lines = [_title];
if (_title isEqualTo "") then {
_title = "ERROR";
};

Expand Down
4 changes: 3 additions & 1 deletion addons/main/script_macros_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ Macro: ERROR()
Macro: ERROR_MSG()
Record a critical error in the RPT log and display on screen error message.
Newlines (\n) in the MESSAGE will be put on separate lines.
Parameters:
MESSAGE - Message to record <STRING>
Expand All @@ -295,7 +297,7 @@ Macro: ERROR_MSG()
Author:
commy2
------------------------------------------- */
#define ERROR_MSG(MESSAGE) ['PREFIX', 'COMPONENT', MESSAGE, nil, __FILE__, __LINE__ + 1] call CBA_fnc_error
#define ERROR_MSG(MESSAGE) ['PREFIX', 'COMPONENT', nil, MESSAGE, __FILE__, __LINE__ + 1] call CBA_fnc_error
#define ERROR_MSG_1(MESSAGE,ARG1) ERROR_MSG(FORMAT_1(MESSAGE,ARG1))
#define ERROR_MSG_2(MESSAGE,ARG1,ARG2) ERROR_MSG(FORMAT_2(MESSAGE,ARG1,ARG2))
#define ERROR_MSG_3(MESSAGE,ARG1,ARG2,ARG3) ERROR_MSG(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))
Expand Down

0 comments on commit caf0ca1

Please sign in to comment.