Skip to content

Commit

Permalink
Merge pull request #1410 from CBATeam/fileExists
Browse files Browse the repository at this point in the history
Use fileExists command (2.02)
  • Loading branch information
PabstMirror committed Feb 23, 2021
2 parents d4a9525 + 37d11f2 commit 450ad36
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions addons/main/script_macros_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1812,9 +1812,9 @@ Macro: IS_ADMIN_LOGGED

/* -------------------------------------------
Macro: FILE_EXISTS
Check if a file exists on machines with interface
Check if a file exists
Reports "false" if the file does not exist and throws an error in RPT.
Reports "false" if the file does not exist.
Parameters:
FILE - Path to the file
Expand All @@ -1828,17 +1828,4 @@ Macro: FILE_EXISTS
Author:
commy2
------------------------------------------- */
#define FILE_EXISTS(FILE) (call {\
private _return = false;\
isNil {\
private _control = (uiNamespace getVariable ["RscDisplayMain", displayNull]) ctrlCreate ["RscHTML", -1];\
if (isNull _control) then {\
_return = loadFile (FILE) != "";\
} else {\
_control htmlLoad (FILE);\
_return = ctrlHTMLLoaded _control;\
ctrlDelete _control;\
};\
};\
_return\
})
#define FILE_EXISTS(FILE) (fileExists (FILE))

0 comments on commit 450ad36

Please sign in to comment.