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

new method for direct call #411

Merged
merged 1 commit into from
Jul 8, 2016
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
4 changes: 0 additions & 4 deletions addons/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ class CfgPatches {

#include "CfgVehicles.hpp"
#include "CfgLocationTypes.hpp"

class CBA_DirectCall {
class dummy;
};
6 changes: 4 additions & 2 deletions addons/common/fnc_directCall.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description:

Parameters:
_code - Code to execute <CODE>
_arguments - Parameters to call the code with. [optional] <ANY>
_arguments - Parameters to call the code with. (optional) <ANY>

Returns:
_return - Return value of the function <ANY>
Expand All @@ -26,6 +26,8 @@ params [["_CBA_code", {}, [{}]], ["_CBA_arguments", []]];

private "_CBA_return";

"_CBA_return = _CBA_arguments call _CBA_code" configClasses (configFile >> "CBA_DirectCall");
isNil {
_CBA_return = _CBA_arguments call _CBA_code;
};

if (!isNil "_CBA_return") then {_CBA_return};