Merge branch 'master' into miscFixNilFunctions

Conflicts:
	addons/common/functions/fnc_execPersistentFnc.sqf
	addons/common/functions/fnc_execRemoteFnc.sqf
This commit is contained in:
PabstMirror 2015-09-20 17:02:49 -05:00
commit 345b1f0f98
65 changed files with 412 additions and 377 deletions

View File

@ -179,6 +179,7 @@ PREP(toBitmask);
PREP(toHex); PREP(toHex);
PREP(toNumber); PREP(toNumber);
PREP(unhideUnit); PREP(unhideUnit);
PREP(uniqueElements);
PREP(uniqueElementsOnly); PREP(uniqueElementsOnly);
PREP(unloadPerson); PREP(unloadPerson);
PREP(unloadPersonLocal); PREP(unloadPersonLocal);

View File

@ -1,24 +1,23 @@
/* /*
* Author: Glowbal * Author: Glowbal
* * Draw progress bar and execute given function if succesful.
* Draw progress bar and execute given function if succesful. * Finish/Failure/Conditional are all passed [args, elapsedTime, totalTime, errorCode]
* Finish/Failure/Conditional are all passed [args, elapsedTime, totalTime, errorCode] *
* * Arguments:
* Argument: * 0: icon ID <STRING>
* 0: icon ID <STRING> * 1: show <BOOL>
* 1: show <BOOL> * 2: Icon Path <STRING>
* 2: Icon Path <STRING> * 3: Icon color <ARRAY>
* 3: Icon color <ARRAY> * 4: timeAlive. -1 = forever (default: 6) <NUMBER>
* 4: timeAlive. -1 = forever <NUMBER> <OPTIONAL> *
* * Return Value:
* Return value: * None
* Nothing *
* * Example:
* Example: * ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1], 0] call ace_gui_fnc_displayIcon;
* ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1], 0] call ace_gui_fnc_displayIcon; *
*/ * Public: Yes
*/
#include "script_component.hpp" #include "script_component.hpp"
// positions for the icon UI // positions for the icon UI
@ -42,31 +41,37 @@
// other constants // other constants
#define DEFAULT_TIME 6 #define DEFAULT_TIME 6
private ["_allControls", "_refresh", "_timeAlive", "_list"];
PARAMS_4(_iconId,_show,_icon,_color);
_timeAlive = if (count _this > 4) then {_this select 4} else {DEFAULT_TIME};
disableSerialization; disableSerialization;
_list = missionNamespace getvariable [QGVAR(displayIconList),[]];
params ["_iconId", "_show", "_icon", "_color", ["_timeAlive", DEFAULT_TIME]];
private ["_list", "_refresh"];
_list = missionNamespace getVariable [QGVAR(displayIconList), []];
_refresh = { _refresh = {
private ["_allControls"];
// Refreshing of all icons.. // Refreshing of all icons..
_allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []]; private "_allControls";
_allControls = missionNamespace getVariable [QGVAR(displayIconListControls), []];
{ {
ctrlDelete _x; ctrlDelete _x;
}foreach _allControls; false
} count _allControls;
_allControls = []; _allControls = [];
private ["_ctrl", "_setting", "_position"]; private ["_setting", "_ctrl", "_position"];
_setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0];
_setting = missionNamespace getVariable [QGVAR(settingFeedbackIcons), 0];
if (_setting > 0) then { if (_setting > 0) then {
{ {
_x params ["", "_xicon", "_xcolor"];
// +19000 because we want to make certain we are using free IDCs.. // +19000 because we want to make certain we are using free IDCs..
_ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]); _ctrl = (findDisplay 46) ctrlCreate ["RscPicture", _forEachIndex + 19000];
_position = switch (_setting) do { _position = switch (_setting) do {
case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]};
@ -74,46 +79,53 @@ _refresh = {
case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]};
default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
}; };
_ctrl ctrlSetPosition _position; _ctrl ctrlSetPosition _position;
_ctrl ctrlsetText (_x select 1); _ctrl ctrlSetText _xicon;
_ctrl ctrlSetTextColor (_x select 2); _ctrl ctrlSetTextColor _xcolor;
_ctrl ctrlCommit 0; _ctrl ctrlCommit 0;
_allControls pushback _ctrl; _allControls pushBack _ctrl;
}foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]); false
} forEach (missionNamespace getVariable [QGVAR(displayIconList),[]]);
}; };
missionNamespace setvariable [QGVAR(displayIconListControls), _allControls];
missionNamespace setVariable [QGVAR(displayIconListControls), _allControls];
}; };
if (_show) then { if (_show) then {
if ({(_x select 0 == _iconId)} count _list == 0) then { if ({_x select 0 == _iconId} count _list == 0) then {
_list pushback [_iconId, _icon, _color, ACE_time]; _list pushBack [_iconId, _icon, _color, ACE_time];
} else { } else {
{ {
if (_x select 0 == _iconId) exitwith { if (_x select 0 == _iconId) exitwith {
_list set [_foreachIndex, [_iconId, _icon, _color, ACE_time]]; _list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]];
}; };
} forEach _list; } forEach _list;
}; };
missionNamespace setvariable [QGVAR(displayIconList), _list];
missionNamespace setVariable [QGVAR(displayIconList), _list];
call _refresh; call _refresh;
if (_timeAlive >= 0) then { if (_timeAlive >= 0) then {
[{ [{
[_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon); [_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon);
}, [_iconId], _timeAlive, _timeAlive] call EFUNC(common,waitAndExecute); }, [_iconId], _timeAlive, _timeAlive] call FUNC(waitAndExecute);
}; };
} else { } else {
if ({(_x select 0 == _iconId)} count _list == 1) then {
if ({_x select 0 == _iconId} count _list == 1) then {
private "_newList"; private "_newList";
_newList = []; _newList = [];
{ {
if (_x select 0 != _iconId) then { if (_x select 0 != _iconId) then {
_newList pushback _x; _newList pushBack _x;
}; };
} forEach _list; false
} count _list;
missionNamespace setvariable [QGVAR(displayIconList), _newList]; missionNamespace setVariable [QGVAR(displayIconList), _newList];
call _refresh; call _refresh;
}; };
}; };

View File

@ -1,42 +1,35 @@
/* /*
* Author: commy2 * Author: commy2
*
* Display a message. * Display a message.
* *
* Argument: * Arguments:
* 0: Message (String) * 0: Message <STRING>
* 1: Play a clicking sound (Bool, optional default: false) * 1: Play a clicking sound (default: false) <BOOL>
* 2: How long before hiding the message in seconds (Number, optional default: 2 sec) * 2: How long before hiding the message in seconds (default: 2) <NUMBER>
* 3: Priority, higher priority messages will override lesser important ones (Number, optional default: 0) * 3: Priority, higher priority messages will override lesser important ones (default: 0) <NUMBER>
* *
* Return value: * Return Value:
* Nothing * None
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
#define DEFAULT_PLAY_SOUND false params ["_text", ["_sound", false], ["_delay", 2], ["_priority", 0]];
#define DEFAULT_DELAY 2
#define DEFAULT_PRIORITY 0
_this resize 4;
private ["_lastHintTime", "_lastHintPriority", "_time"];
PARAMS_4(_text,_sound,_delay,_priority);
if (isNil QGVAR(lastHint)) then { if (isNil QGVAR(lastHint)) then {
GVAR(lastHint) = [0, 0]; GVAR(lastHint) = [0, 0];
}; };
if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
private ["_lastHintTime", "_lastHintPriority", "_time"];
_lastHintTime = GVAR(lastHint) select 0; _lastHintTime = GVAR(lastHint) select 0;
_lastHintPriority = GVAR(lastHint) select 1; _lastHintPriority = GVAR(lastHint) select 1;
if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND};
if (isNil "_delay") then {_delay = DEFAULT_DELAY};
if (isNil "_priority") then {_priority = DEFAULT_PRIORITY};
_time = ACE_time; _time = ACE_time;
if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
hintSilent _text; hintSilent _text;
if (_sound) then {playSound "ACE_Sound_Click"}; if (_sound) then {playSound "ACE_Sound_Click"};

View File

@ -4,11 +4,12 @@
* End radio transmissions of addons TFAR and ACRE2. TFAR v0.9.7, ACRE Public Beta 2.0.3.571 * End radio transmissions of addons TFAR and ACRE2. TFAR v0.9.7, ACRE Public Beta 2.0.3.571
* *
* Arguments: * Arguments:
* None. * None
* *
* Return Value: * Return Value:
* None. * None
* *
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -13,6 +13,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_namespace,_uid); params ["_namespace", "_uid"];
_namespace setVariable [_uid, nil]; _namespace setVariable [_uid, nil];

View File

@ -29,11 +29,7 @@ if (isNull (call BIS_fnc_displayMission)) exitWith {
}, 1, _this] call CBA_fnc_addPerFrameHandler; }, 1, _this] call CBA_fnc_addPerFrameHandler;
}; };
private ["_onOK", "_onCancel"]; params ["_textHeader", "_textMessage", ["_onOK", {}], ["_onCancel", {}]];
PARAMS_2(_textHeader,_textMessage);
_onOK = ARR_SELECT(_this,2,{});
_onCancel = ARR_SELECT(_this,3,{});
if (typeName _textMessage == "STRING") then { if (typeName _textMessage == "STRING") then {
_textMessage = parseText _textMessage; _textMessage = parseText _textMessage;

View File

@ -1,18 +1,19 @@
/* /*
* Author: esteldunedain * Author: esteldunedain
*
* Executes a code on the next frame * Executes a code on the next frame
* *
* Argument: * Arguments:
* 0: Code to execute (Code) * 0: Code to execute <CODE>
* 1: Parameters to run the code with (Array) * 1: Parameters to run the code with <ARRAY>
* *
* Return value: * Return Value:
* PFH handler ID * PFH handler ID <NUMBER>
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_func,_params); params ["_func", "_params"];
if (diag_frameno != GVAR(nextFrameNo)) then { if (diag_frameno != GVAR(nextFrameNo)) then {
GVAR(nextFrameBufferA) pushBack [_params, _func]; GVAR(nextFrameBufferA) pushBack [_params, _func];

View File

@ -1,27 +1,29 @@
/* /*
* Author: commy2 * Author: commy2
*
* Execute a function on every machine. Function will also be called upon JIP (postInit). The arguments are stored in (_this select 0), while the assigned namespace is stored in (_this select 1). * Execute a function on every machine. Function will also be called upon JIP (postInit). The arguments are stored in (_this select 0), while the assigned namespace is stored in (_this select 1).
* *
* Argument: * Arguments:
* 0: Function arguments (Array) * 0: Function arguments <ARRAY>
* 1: Function to execute, has to be defined on the remote machine first (String) * 1: Function to execute, has to be defined on the remote machine first <STRING>
* 2: Namespace to save that variable in (Object or Namespace) * 2: Namespace to save that variable in <OBJECT, NAMESPACE>
* 3: Name. Will overwrite previously defined functions with that name (String) * 3: Name. Will overwrite previously defined functions with that name <STRING>
* *
* Return value: * Return Value:
* Nothing. * None
*
* Public: No
*
* Deprecated
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_arguments", "_function", "_unit", "_name"];
GVAR(remoteFnc) = _this; GVAR(remoteFnc) = _this;
_arguments = _this select 0; params ["_arguments", "_function", "_unit", "_name"];
_function = call compile (_this select 1);
_unit = _this select 2; _function = call compile _function;
_name = _this select 3;
//["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log);
// execute function on every currently connected machine // execute function on every currently connected machine
[[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); [[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc);

View File

@ -1,33 +1,32 @@
/* /*
* Author: commy2 * Author: commy2
*
* Execute a function on a remote machine in mp. * Execute a function on a remote machine in mp.
* *
* Argument: * Arguments:
* 0: Function arguments (Array) * 0: Function arguments <ARRAY>
* 1: Function to execute, has to be defined on the remote machine first (String) * 1: Function to execute, has to be defined on the remote machine first <STRING>
* 2: The function will be executed where this unit is local OR the mode were this function should be executed. (Object OR Number, optional default: 2) * 2: The function will be executed where this unit is local OR the mode were this function should be executed. (default: 2) <OBJECT, NUMBER>
* Mode 0: execute on this machine only * 0 = execute on this machine only
* Mode 1: execute on server * 1 = execute on server
* Mode 2: execute on all clients + server * 2 = execute on all clients + server
* Mode 3: execute on dedicated only * 3 = execute on dedicated only
* *
* Return value: * Return Value:
* Nothing * None
*
* Public: No
*
* Deprecated
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_arguments", "_function", "_unit", "_id"];
GVAR(remoteFnc) = _this; GVAR(remoteFnc) = _this;
_arguments = _this select 0; params ["_arguments", "_function", ["_unit", 2]];
_function = call compile (_this select 1);
_unit = _this select 2;
if (isNil "_unit") then { _function = call compile _function;
_unit = 2;
}; //["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log);
if (typeName _unit == "SCALAR") exitWith { if (typeName _unit == "SCALAR") exitWith {
switch (_unit) do { switch (_unit) do {
@ -61,8 +60,7 @@ if (local _unit) then {
_arguments call _function; _arguments call _function;
} else { } else {
if (isServer) then { if (isServer) then {
_id = owner _unit; (owner _unit) publicVariableClient QGVAR(remoteFnc);
_id publicVariableClient QGVAR(remoteFnc);
} else { } else {
publicVariableServer QGVAR(remoteFnc); publicVariableServer QGVAR(remoteFnc);
}; };

View File

@ -1,11 +1,22 @@
// by commy2 /*
* Author: commy2
* Execute all Persistent Functions
*
* Arguments:
* ?
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_1(_target); params ["_target"];
{ {
if (isNil "_x") then { if (isNil "_x") then {
ACE_LOGERROR_1("No argument and function for remote function. ID: %1",_forEachIndex); ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex);
} else { } else {
if (typeName _x == "ARRAY") then { if (typeName _x == "ARRAY") then {
[_x select 0, _target] call (_x select 1); [_x select 0, _target] call (_x select 1);

View File

@ -1,17 +1,25 @@
// by commy2
/* /*
usage: * Author: commy2
* Export Config Entrys to RPT logs
(configFile >> "CfgAmmo") call FUNC(exportConfig); *
*/ * Arguments:
* Config Path <CONFIG>
*
* Return Value:
* None
*
* Example:
* [configFile >> "CfgAmmo"] call ace_common_fnc_exportConfig;
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private "_fnc_logEntries"; private "_fnc_logEntries";
_fnc_logEntries = { _fnc_logEntries = {
private ["_p", "_t", "_e", "_a", "_i"]; params ["_c", "_d"];
PARAMS_2(_c,_d); private ["_p", "_t", "_e", "_a", "_i"];
_p = inheritsFrom _c; _p = inheritsFrom _c;

View File

@ -1,6 +1,5 @@
/* /*
* Author: KoffeinFlummi, commy2 * Author: KoffeinFlummi, commy2
*
* Filters array and removes every element not fitting the condition * Filters array and removes every element not fitting the condition
* *
* Arguments: * Arguments:
@ -12,22 +11,21 @@
* *
* Usage: * Usage:
* [[0,1,2,3,4], {_this > 2}] call FUNC(filter) ==> [3,4] * [[0,1,2,3,4], {_this > 2}] call FUNC(filter) ==> [3,4]
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_newArray", "_index"]; params ["_array", "_code"];
PARAMS_2(_array,_code); private "_result";
_result = [];
if (isNil "_array") exitWith { {
ACE_LOGERROR_1("No array for function filter in %1.",_fnc_scriptNameParent); if (_x call _code) then {
[] _result pushBack _x;
};
_newArray = [];
for "_index" from 0 to (count _array - 1) do {
if ((_array select _index) call _code) then {
_newArray pushBack (_array select _index);
}; };
}; false
_newArray } count _array;
_result

View File

@ -1,13 +1,14 @@
/* /*
* Author: commy2 * Author: commy2
* Attempt to fix physx collisions causing unreasonable impact forces and damage. * Attempt to fix PhysX collisions causing unreasonable impact forces and damage.
* *
* Arguments: * Arguments:
* 0: Object <OBJECT> * Object <OBJECT>
* *
* Return Value: * Return Value:
* Nothing * None
* *
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -1,9 +1,20 @@
// by commy2 /*
* Author: commy2
* Fixes zeus placed crates containing buged mine detectors and ace items.
*
* Arguments:
* 0: Crate <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_weapons", "_items"]; params ["_crate"];
PARAMS_1(_crate); private ["_weapons", "_items"];
// get all weapons inside the crate // get all weapons inside the crate
_weapons = weaponCargo _crate; _weapons = weaponCargo _crate;

View File

@ -3,16 +3,16 @@
* Attempt to fix floating physx with disabled damage after setPosXXX commands. * Attempt to fix floating physx with disabled damage after setPosXXX commands.
* *
* Arguments: * Arguments:
* Physx object (Object) * PhysX object <OBJECT>
* *
* Return Value: * Return Value:
* Nothing * None
* *
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_object"; private "_object";
_object = _this; _object = _this;
// setHitPointDamage requires local object // setHitPointDamage requires local object

View File

@ -15,8 +15,8 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_1(_unit); params ["_unit"];
if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {(vehicle _unit) == _unit}) then { if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {vehicle _unit == _unit}) then {
[_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation);
}; };

View File

@ -4,10 +4,12 @@
* Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object. * Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object.
* *
* Argument: * Argument:
* Object (Object) * Object <OBJECT>
* *
* Return value: * Return Value:
* NONE * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -3,18 +3,20 @@
* *
* Execute a global event on all clients, including self. * Execute a global event on all clients, including self.
* *
* Argument: * Arguments:
* 0: Event name (string) * 0: Event name <STRING>
* 1: Event args (any) * 1: Event args <ANY>
* *
* Return value: * Return Value:
* Nothing * None
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
//IGNORE_PRIVATE_WARNING("_handleNetEvent");
PARAMS_2(_eventName,_eventArgs); params ["_eventName", "_eventArgs"];
ACEg = [_eventName, _eventArgs]; ACEg = [_eventName, _eventArgs];
publicVariable "ACEg"; publicVariable "ACEg";
["ACEg", ACEg] call FUNC(_handleNetEvent);
["ACEg", ACEg] call FUNC(_handleNetEvent);

View File

@ -1,32 +1,22 @@
/* /*
* Author: commy2 * Author: commy2
* Move unit to kneeling position.
* *
* Abhocken! Unit goes kneeling if not prone already and lowers weapon. Try, throw, catch because I'm bored. * Arguments:
* 0: Unit <OBJECT>
* *
* Argument: * Return Value:
* 0: Unit (Object) * None
* *
* Return value: * Public: No
* None.
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_1(_unit); params ["_unit"];
//IGNORE_PRIVATE_WARNING("_exception"); if (stance _unit == "PRONE") exitWith {};
try { [
if (_unit == vehicle _unit) then { _unit,
switch (currentWeapon _unit) do { ["AmovPknlMstpSnonWnonDnon", "AmovPknlMstpSlowWrflDnon", "AmovPknlMstpSrasWlnrDnon", "AmovPknlMstpSlowWpstDnon", "AmovPknlMstpSoptWbinDnon"] select ((["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit, binocular _unit] find currentWeapon _unit) max 0)
case "" : {throw "AmovPknlMstpSnonWnonDnon"}; ] call FUNC(doAnimation);
case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"};
case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"};
case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"};
case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"};
};
};
} catch {
if (stance _unit != "PRONE") then {
[_unit, _exception] call FUNC(doAnimation);
};
};

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -3,10 +3,10 @@
* Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true. * Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true.
* *
* Argument: * Argument:
* 0: Any object (Object) * 0: Any object <OBJECT>
* *
* Return value: * Return value:
* The object exists and is alive (Bool). * The object exists and is alive <BOOL>.
* *
* Public: Yes * Public: Yes
* *
@ -14,4 +14,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
!isNull (_this select 0) && {alive (_this select 0)} params ["_unit"];
!isNull _unit && {alive _unit} // return

View File

@ -1,6 +1,5 @@
/* /*
* Author: Glowbal * Author: Glowbal
*
* Check if unit is awake. Will be false when death or unit is unconscious. * Check if unit is awake. Will be false when death or unit is unconscious.
* *
* Arguments: * Arguments:
@ -15,4 +14,4 @@
params ["_unit"]; params ["_unit"];
!(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]); !(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]) // return

View File

@ -12,4 +12,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
isClass (configFile >> "cfgPatches" >> _this select 0) // return params ["_modName"];
isClass (configFile >> "cfgPatches" >> _modName) // return

View File

@ -12,7 +12,7 @@
* Usage: * Usage:
* [["2", "gobblecock", "25"], {parseNumber _this}] call FUNC(map) ==> [2, 0, 25] * [["2", "gobblecock", "25"], {parseNumber _this}] call FUNC(map) ==> [2, 0, 25]
* *
* Public: No * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
@ -24,4 +24,5 @@ _array = + _array;
{ {
_array set [_forEachIndex, _x call _code]; _array set [_forEachIndex, _x call _code];
} forEach _array; } forEach _array;
_array _array

View File

@ -1,6 +1,5 @@
/* /*
* Author: KoffeinFlummi, joko // Jonas * Author: KoffeinFlummi, joko // Jonas
*
* Nothing to see here, move along. * Nothing to see here, move along.
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 * Author: commy2
*
* Counterpart of ace_common_fnc_claim. Check if the given object is claimed by another unit. * Counterpart of ace_common_fnc_claim. Check if the given object is claimed by another unit.
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: bux578, commy2 * Author: bux578, commy2
*
* Returns the player or curator controlled unit. * Returns the player or curator controlled unit.
* Use this in INIT and RESPAWN eh scripts, because ACE_player isn't reset yet. * Use this in INIT and RESPAWN eh scripts, because ACE_player isn't reset yet.
* *

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 * Author: commy2
*
* Return the current side of the player * Return the current side of the player
* *
* Arguments: * Arguments:

View File

@ -10,7 +10,7 @@
* Return Value: * Return Value:
* None * None
* *
* Public: No * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -1,6 +1,5 @@
/* /*
* Author: esteldunedain * Author: esteldunedain
*
* Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module. * Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module.
* Must be called on the server, effect is global. * Must be called on the server, effect is global.
* *

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 * Author: commy2
*
* Remove a condition that gets checked by ace_common_fnc_canInteractWith. * Remove a condition that gets checked by ace_common_fnc_canInteractWith.
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 * Author: commy2
*
* Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP). * Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP).
* *
* Arguments: * Arguments:

View File

@ -4,7 +4,7 @@
* *
* Arguments: * Arguments:
* 0: Source string <STRING> * 0: Source string <STRING>
* 1: Remove html tags (optional) <BOOL> * 1: Remove html tags (default: false) <BOOL>
* *
* Return Value: * Return Value:
* Sanitized string * Sanitized string
@ -15,28 +15,37 @@
params ["_string", ["_removeTags", false]]; params ["_string", ["_removeTags", false]];
private ["_array", "_arrayNew"]; private "_array";
_array = [];
_array = toArray _string;
_arrayNew = [];
{ {
switch _x do { switch _x do {
case 60 : { case 60 : {
_arrayNew = if (_removeTags) then {_arrayNew + toArray "&lt;";} else {_arrayNew + [_x];}; if (_removeTags) then {
_array append toArray "&lt;";
} else {
_array pushBack _x;
};
}; };
case 62 : { case 62 : {
_arrayNew = if (_removeTags) then {_arrayNew + toArray "&gt;";} else {_arrayNew + [_x];}; if (_removeTags) then {
_array append toArray "&gt;";
} else {
_array pushBack _x;
};
}; };
case 34 : { case 34 : {
}; };
case 39 : { case 39 : {
}; };
default { default {
_arrayNew = _arrayNew + [_x]; _array pushBack _x;
}; };
}; };
false false
} count _array; } count toArray _string;
toString _arrayNew toString _array // return

View File

@ -11,6 +11,8 @@
* None * None
* *
* Public: Yes * Public: Yes
*
* Note: uses player
*/ */
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 * Author: commy2
*
* Sets the name variable of the object. Used to prevent issues with the name command. * Sets the name variable of the object. Used to prevent issues with the name command.
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: esteldunedain * Author: esteldunedain
*
* Sets the value of an ACE_Parameter and makes it public. * Sets the value of an ACE_Parameter and makes it public.
* *
* Arguments: * Arguments:
@ -12,7 +11,7 @@
* *
* Public: Yes * Public: Yes
* *
* Deprecated *@todo commy * Deprecated
*/ */
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 * Author: commy2
*
* Sets a public object namespace variable that gets reset with the same value after respawn, so JIP clients keep the value. * Sets a public object namespace variable that gets reset with the same value after respawn, so JIP clients keep the value.
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 and joko // Jonas * Author: commy2 and joko // Jonas
*
* Sets a public variable, but wait a certain amount of ACE_time to transfer the value over the network. Changing the value by calling this function again resets the windup timer. * Sets a public variable, but wait a certain amount of ACE_time to transfer the value over the network. Changing the value by calling this function again resets the windup timer.
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,6 @@
/* /*
* Author: Glowbal * Author: Glowbal
* ? deprecated * ?
* *
* Arguments: * Arguments:
* ? * ?

View File

@ -1,35 +1,41 @@
/** /*
* fn_stringCompare.sqf * Author: bovine3dom
* @Descr: Determines whether one string matches another and how many characters match. Case insensitive. * Determines whether one string matches another and how many characters match. Case insensitive.
* @Author: bovine3dom
* *
* @Arguments: [stringA STRING, stringB STRING] * Arguments:
* @Return: NUMBER Number of matching characters * 0: stringA <STRING>
* @PublicAPI: true * 1: stringB <STRING>
*
* Return Value:
* Number of matching characters >NUMBER>
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_searchTerm", "_string", "_arraySearchTerm", "_arrayString", "_sizeSearchTerm", "_sizeString", "_matchingCharacters", "_searchIterator", "_targetIterator"]; params ["_string", "_searchTerm"];
_string = toLower (_this select 0); // removes case sensitivity
_searchTerm = toLower (_this select 1);
_string = toLower _string; // removes case sensitivity
_searchTerm = toLower _searchTerm;
private ["_arraySearchTerm", "_arrayString", "_sizeSearchTerm", "_sizeString", "_matchingCharacters", "_searchIterator", "_targetIterator"];
_arraySearchTerm = toArray _searchTerm; // splits string into array of unicode decimals _arraySearchTerm = toArray _searchTerm; // splits string into array of unicode decimals
_arrayString = toArray _string; _arrayString = toArray _string;
_sizeSearchTerm = count _arraySearchTerm; // We only measure the array once _sizeSearchTerm = count _arraySearchTerm; // We only measure the array once
_sizeString = count _arrayString; _sizeString = count _arrayString;
_matchingCharacters = 0; _matchingCharacters = 0;
_targetIterator = 0;
_searchIterator = 0; _searchIterator = 0;
while {(_searchIterator < _sizeSearchTerm) && (_targetIterator < _sizeString)} do { // Prevents us from going out of bounds _targetIterator = 0;
if ((_arraySearchTerm select _searchIterator) == (_arrayString select _targetIterator)) then { // If we have a match, start looking for the next character in the search term
while {_searchIterator < _sizeSearchTerm && _targetIterator < _sizeString} do { // Prevents us from going out of bounds
if (_arraySearchTerm select _searchIterator == _arrayString select _targetIterator) then { // If we have a match, start looking for the next character in the search term
_matchingCharacters = _matchingCharacters + 1; _matchingCharacters = _matchingCharacters + 1;
_searchIterator = _searchIterator + 1 _searchIterator = _searchIterator + 1
}; };
_targetIterator = _targetIterator + 1; // Look at the next character in the string _targetIterator = _targetIterator + 1; // Look at the next character in the string
}; };
_matchingCharacters _matchingCharacters

View File

@ -10,17 +10,9 @@
* copy of string <STRING> * copy of string <STRING>
* *
* Public: Yes * Public: Yes
*
* Deprecated
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_string", ""]; params ["_string"];
private ["_charArray", "_returnString"]; (_string splitString " ") joinString ""
_charArray = toArray _string;
_charArray = _charArray - [((toArray " ") select 0)];
_returnString = toString _charArray;
_returnString

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 * Author: commy2
*
* Create a centered, colored text. * Create a centered, colored text.
* *
* Arguments: * Arguments:

View File

@ -1,33 +1,27 @@
/* /*
* Author: jaynus * Author: jaynus
*
* Call and propegate a synced event * Call and propegate a synced event
* *
* Argument: * Arguments:
* 0: Name (String) * 0: Name <STRING>
* 1: Arguments (Array) * 1: Arguments <ARRAY>
* 2: TTL (Number or Code) [Optional] for this specific event call * 2: TTL <NUMBER, CODE> [Optional] for this specific event call
* *
* Return value: * Return Value:
* Boolean of success * Boolean of success <BOOL>
*
* Public: No
*/ */
//#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_name,_args); params ["_name", "_args", ["_ttl", 0]];
private["_ttl", "_eventData"]; if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if( (count _this) > 2) then {
_ttl = _this select 2;
} else {
_ttl = 0;
};
if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR("Synced event key not found."); ACE_LOGERROR("Synced event key not found.");
false false
}; };
_eventData = [_name, _args,_ttl]; private "_eventData";
_eventData = [_name, _args, _ttl];
["SEH", _eventData] call FUNC(globalEvent); ["SEH", _eventData] call FUNC(globalEvent);

View File

@ -1,52 +1,66 @@
//#define DEBUG_MODE_FULL /*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp" #include "script_component.hpp"
if(!isServer) exitWith { false }; if (!isServer) exitWith {false};
// Walk through the local synced events and clean up anything thats already EOL // Walk through the local synced events and clean up anything thats already EOL
// @TODO: This should be iteration limited to prevent FPS lag // @TODO: This should be iteration limited to prevent FPS lag
private["_data"];
{ {
private["_data", "_eventLog", "_newEventLog", "_name", "_globalEventTTL"]; private ["_name", "_data", "_newEventLog"];
_name = _x; _name = _x;
_data = HASH_GET(GVAR(syncedEvents),_name); _data = HASH_GET(GVAR(syncedEvents),_name);
_eventLog = _data select 1; _data params ["_eventTime", "_eventLog", "_globalEventTTL"];
_globalEventTTL = _data select 2;
_newEventLog = []; _newEventLog = [];
// @TODO: This should be iteration limited to prevent FPS lag // @TODO: This should be iteration limited to prevent FPS lag
{ {
private["_eventEntry", "_ttlReturn"]; private ["_eventEntry", "_ttlReturn"];
_eventEntry = _x; _eventEntry = _x;
_ttlReturn = true; _ttlReturn = true;
if(typeName _globalEventTTL == "CODE") then {
_ttlReturn = [(_data select 0),_eventEntry] call _globalEventTTL; if (typeName _globalEventTTL == "CODE") then {
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
} else { } else {
_ttlReturn = call { _globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL} }; _ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}};
}; };
if(_ttlReturn) then { if (_ttlReturn) then {
// Do event based TTL check // Do event based TTL check
private["_eventTTL"]; _eventEntry params ["_time", "", "_eventTTL"];
_eventTTL = _eventEntry select 2;
if (typeName _eventTTL == "CODE") then {
if(typeName _eventTTL == "CODE") then { _ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
_ttlReturn = [(_data select 0),_eventEntry] call _eventTTL;
} else { } else {
_ttlReturn = call { _eventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _eventTTL} }; _ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}};
}; };
}; };
// Finally drop it if the TTL check fails // Finally drop it if the TTL check fails
if(_ttlReturn) then { if (_ttlReturn) then {
_newEventLog pushBack _x; _newEventLog pushBack _x;
}; };
} forEach _eventLog; false
} count _eventLog;
_data set[1, _newEventLog];
} forEach (GVAR(syncedEvents) select 0);
_data set [1, _newEventLog];
false
} count (GVAR(syncedEvents) select 0);
// @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events // @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events

View File

@ -17,21 +17,20 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_unit,_varName,_maxDelay); params ["_unit", "_varName", "_maxDelay"];
// Create the publish scheduler PFH the first ACE_time // Create the publish scheduler PFH the first ACE_time
if (isNil QGVAR(publishSchedId)) then { if (isNil QGVAR(publishSchedId)) then {
GVAR(publishVarNames) = []; GVAR(publishVarNames) = [];
GVAR(publishNextTime) = 1e7; GVAR(publishNextTime) = 1e7;
GVAR(publishSchedId) = [{ GVAR(publishSchedId) = [{
if (ACE_diagTime > GVAR(publishNextTime)) then { if (ACE_diagTime > GVAR(publishNextTime)) then {
{ {
EXPLODE_2_PVT(_x,_unit,_varName); _x params [_unit, _varName];
_unit setVariable [_varName, (_unit getVariable _varName), true]; _unit setVariable [_varName, _unit getVariable _varName, true];
} forEach GVAR(publishVarNames); false
} count GVAR(publishVarNames);
GVAR(publishVarNames) = []; GVAR(publishVarNames) = [];
GVAR(publishNextTime) = 1e7; GVAR(publishNextTime) = 1e7;
@ -40,10 +39,10 @@ if (isNil QGVAR(publishSchedId)) then {
}; };
// If the variable is not on the list // If the variable is not on the list
if (GVAR(publishVarNames) find [_unit,_varName] == -1) exitWith { if (GVAR(publishVarNames) find [_unit, _varName] == -1) exitWith {
GVAR(publishVarNames) pushBack [_unit,_varName]; GVAR(publishVarNames) pushBack [_unit, _varName];
GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay); GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay);
}; };
// If the variable is on the list // If the variable is on the list
GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay); GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay);

View File

@ -21,6 +21,7 @@ ACE_gameTime = time;
ACE_diagTime = diag_tickTime; ACE_diagTime = diag_tickTime;
_delta = ACE_diagTime - _lastTickTime; _delta = ACE_diagTime - _lastTickTime;
if (ACE_gameTime <= _lastGameTime) then { if (ACE_gameTime <= _lastGameTime) then {
TRACE_1("paused",_delta); TRACE_1("paused",_delta);
ACE_paused = true; ACE_paused = true;

View File

@ -12,14 +12,11 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_array", "_result"]; private "_result";
_array = _this;
_result = 0; _result = 0;
{ {
if (_x) then {_result = _result + 2 ^ _forEachIndex}; if (_x) then {_result = _result + 2 ^ _forEachIndex};
} forEach _array; } forEach _this;
_result _result

View File

@ -1,6 +1,5 @@
/* /*
* Author: Garth de Wet (LH) * Author: Garth de Wet (LH)
*
* Takes a string/number and returns the number. * Takes a string/number and returns the number.
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: ? * Author: ?
*
* ? * ?
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,5 @@
/* /*
* Author: SilentSpike (based on unmuteUnit) * Author: SilentSpike (based on unmuteUnit)
*
* Globally unhides a unit. Only unhides if the last reason was removed. * Globally unhides a unit. Only unhides if the last reason was removed.
* *
* Arguments: * Arguments:

View File

@ -0,0 +1,17 @@
/*
* Author: Glowbal
* Make a copy of an array with only the unique elements.
*
* Arguments:
* 0: array <ARRAY>
*
* Return Value:
* Copy of original array <ARRAY>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_array"];
_array arrayIntersect _array // return

View File

@ -1,24 +1,17 @@
/** /*
* fn_uniqueElementsOnly.sqf * Author: Glowbal
* @Descr: Make a copy of an array with only the unique elements. * Make a copy of an array with only the unique elements.
* @Author: Glowbal
* *
* @Arguments: [array ARRAY] * Arguments:
* @Return: ARRAY Copy of original array * 0: array <ARRAY>
* @PublicAPI: true *
* Return Value:
* Copy of original array <ARRAY>
*
* Public: Yes
*
* Deprecated
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_result", "_value"]; _this call FUNC(uniqueElements)
PARAMS_1(_array);
_result = [];
{
_value = _x;
if ({_x isEqualTo _value} count _result == 0) then {
_result pushback _x;
};
} forEach _array;
_result;

View File

@ -1,6 +1,5 @@
/* /*
* Author: commy2 * Author: commy2
*
* Unmutes the unit. Only unmutes if the last reason was removed. * Unmutes the unit. Only unmutes if the last reason was removed.
* *
* Arguments: * Arguments:

View File

@ -1,36 +1,37 @@
/** /*
* fn_useItem.sqf * Author: Glowbal
* @Descr: * Use item
* @Author: Glowbal
* *
* @Arguments: [] * Arguments:
* @Return: * 0: unit <OBJECT>
* @PublicAPI: true * 1: item <STRING>
*
* Return Value:
* if item has been used. <BOOL>
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_item); params ["_unit", "_item", ["_vehicleUsage", false]];
private ["_return", "_vehicleUsage"];
_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param;
private "_return";
_return = false; _return = false;
if (!_vehicleUsage) then {
if !(_vehicleUsage) then {
if (_item != "") then { if (_item != "") then {
if (_item in (items _unit)) then { if (_item in items _unit) then {
_unit removeItem _item; _unit removeItem _item;
_return = true; _return = true;
} else { } else {
if (_item in (assignedItems _unit)) then { if (_item in assignedItems _unit) then {
_unit unassignItem _item; _unit unlinkItem _item;
_unit removeItem _item;
_return = true; _return = true;
}; };
}; };
}; };
//} else {
// @todo implement shared item functionality for with vehicles.
}; };
// TODO implement shared item functionality for with vehicles.
_return; _return

View File

@ -1,28 +1,32 @@
/** /*
* fn_useMagazine.sqf * Author: Glowbal
* @Descr: Use magazine * Use magazine
* @Author: Glowbal
* *
* @Arguments: [unit OBJECt, magazine STRING] * Arguments:
* @Return: BOOL True if magazine has been used. * 0: unit <OBJECT>
* @PublicAPI: true * 1: magazine <STRING>
*
* Return Value:
* if magazine has been used. <BOOL>
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_return", "_vehicleUsage"]; params ["_unit", "_magazine", ["_vehicleUsage", false]];
PARAMS_2(_unit,_magazine);
_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param;
if (!_vehicleUsage) then { private "_return";
_return = false;
if !(_vehicleUsage) then {
if (_magazine != "") then { if (_magazine != "") then {
_unit removeMagazine _magazine; _unit removeMagazine _magazine;
_return = true; _return = true;
} else {
_return = false;
}; };
[format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug);
[format ["fnc_useMagazine: %1 | %2", _this, _return]] call FUNC(debug);
//} else {
// @todo implement shared magazine functionality
};
_return _return
} else {
// TODO implement shared magazine functionality
};

View File

@ -1,6 +1,5 @@
/* /*
* Author: esteldunedain * Author: esteldunedain
*
* Executes a code once with a given game ACE_time delay, using a PFH * Executes a code once with a given game ACE_time delay, using a PFH
* *
* Arguments: * Arguments:
@ -20,5 +19,5 @@
params ["_func", "_params", "_delay"]; params ["_func", "_params", "_delay"];
GVAR(waitAndExecArray) pushBack [(ACE_time + _delay), _func, _params]; GVAR(waitAndExecArray) pushBack [ACE_time + _delay, _func, _params];
GVAR(waitAndExecArray) sort true; GVAR(waitAndExecArray) sort true;

View File

@ -19,6 +19,7 @@ params ["_position"];
if (isNil QGVAR(waveHeightLogic)) then { if (isNil QGVAR(waveHeightLogic)) then {
GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0]; GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0];
}; };
GVAR(waveHeightLogic) setPosASL _position; GVAR(waveHeightLogic) setPosASL _position;
(getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2) (getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2)