Skip to content

Commit caf0ca1

Browse files
authored
Merge pull request #525 from CBATeam/make-ERROR_MSG-support-newlines
add support for \n to ERROR_MSG()
2 parents a4ecc39 + 6db7a79 commit caf0ca1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

addons/diagnostic/fnc_error.sqf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ disableSerialization;
4949
QGVAR(Error) cutRsc [QGVAR(Error), "PLAIN"];
5050
private _control = uiNamespace getVariable QGVAR(Error);
5151

52-
if (_message isEqualTo "") then {
53-
_lines = [_title];
52+
if (_title isEqualTo "") then {
5453
_title = "ERROR";
5554
};
5655

addons/main/script_macros_common.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ Macro: ERROR()
284284
Macro: ERROR_MSG()
285285
Record a critical error in the RPT log and display on screen error message.
286286
287+
Newlines (\n) in the MESSAGE will be put on separate lines.
288+
287289
Parameters:
288290
MESSAGE - Message to record <STRING>
289291
@@ -295,7 +297,7 @@ Macro: ERROR_MSG()
295297
Author:
296298
commy2
297299
------------------------------------------- */
298-
#define ERROR_MSG(MESSAGE) ['PREFIX', 'COMPONENT', MESSAGE, nil, __FILE__, __LINE__ + 1] call CBA_fnc_error
300+
#define ERROR_MSG(MESSAGE) ['PREFIX', 'COMPONENT', nil, MESSAGE, __FILE__, __LINE__ + 1] call CBA_fnc_error
299301
#define ERROR_MSG_1(MESSAGE,ARG1) ERROR_MSG(FORMAT_1(MESSAGE,ARG1))
300302
#define ERROR_MSG_2(MESSAGE,ARG1,ARG2) ERROR_MSG(FORMAT_2(MESSAGE,ARG1,ARG2))
301303
#define ERROR_MSG_3(MESSAGE,ARG1,ARG2,ARG3) ERROR_MSG(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))

0 commit comments

Comments
 (0)