Private Variables

This commit is contained in:
PabstMirror 2015-04-29 00:05:02 -05:00
parent 409851dd8c
commit e56838be36
18 changed files with 36 additions and 18 deletions

View File

@ -37,7 +37,7 @@ player addEventHandler ["Killed", {
} count _deadman;
}];
player addEventHandler ["Take", {
private ["_item", "_getter", "_giver", "_config"];
private ["_item", "_getter", "_giver", "_config", "_detonators"];
_item = _this select 2;
_getter = _this select 0;
_giver = _this select 1;

View File

@ -17,7 +17,11 @@
* Public: No
*/
#include "script_component.hpp"
EXPLODE_4_PVT(_this,_unit,_explosive,_magazineClass,_extra);
private["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"];
// Config is the last item in the list of passed in items.
_config = (_this select 3) select (count (_this select 3) - 1);
@ -29,7 +33,7 @@ _detonators = [_unit] call FUNC(getDetonators);
_hasRequired = false;
};
} count _requiredItems;
private ["_code", "_count", "_codeSet"];
_codeSet = false;
while {!_codeSet} do {
_code = str(round (random 9999));

View File

@ -17,7 +17,7 @@
* Public: Yes
*/
#include "script_component.hpp"
private ["_clacker", "_config", "_requiredItems", "_hasRequired"];
private ["_clacker", "_config", "_requiredItems", "_hasRequired", "_detonators"];
EXPLODE_3_PVT(_this,_unit,_explosive,_magazineClass);
// Config is the last item in the list of passed in items.
_config = (_this select 3) select (count (_this select 3) - 1);

View File

@ -15,7 +15,7 @@
* Public: No
*/
#include "script_component.hpp"
private ["_result", "_item", "_children"];
private ["_result", "_item", "_children", "_range", "_required"];
EXPLODE_2_PVT(_this,_unit,_detonator);
_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");

View File

@ -11,7 +11,7 @@
* Public: No
*/
#include "script_component.hpp"
private ["_mags", "_item", "_index", "_children"];
private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"];
EXPLODE_1_PVT(_this,_unit);

View File

@ -14,7 +14,7 @@
* Public: No
*/
#include "script_component.hpp"
private ["_items", "_unit", "_children", "_config"];
private ["_unit", "_children", "_config", "_detonators"];
_unit = _this select 0;
_detonators = [_unit] call FUNC(getDetonators);
_children = [];

View File

@ -15,8 +15,7 @@
* Public: No
*/
#include "script_component.hpp"
private ["_hasRequiredItems","_triggerTypes", "_children",
"_detonators", "_required", "_magTriggers"];
private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers"];
EXPLODE_2_PVT(_this,_magazine,_explosive);
_detonators = [ACE_player] call FUNC(getDetonators);

View File

@ -14,7 +14,7 @@
* Public: Yes
*/
#include "script_component.hpp"
private ["_specialist"];
private ["_isSpecialist"];
EXPLODE_2_PVT(_this,_unit,_target);
if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith {
deleteVehicle _target;

View File

@ -19,7 +19,7 @@
* Public: Yes
*/
#include "script_component.hpp"
private ["_result", "_ignoreRange", "_helper"];
private ["_result", "_ignoreRange", "_helper", "_pos"];
EXPLODE_3_PVT(_this,_unit,_range,_item);
_ignoreRange = (_range == -1);
_result = true;
@ -46,10 +46,11 @@ if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhe
};
};
[{
_explosive = _this;
if (!isNull _explosive) then {
_explosive setDamage 1;
};
private ["_explosive"];
_explosive = _this;
if (!isNull _explosive) then {
_explosive setDamage 1;
};
}, _item select 0, _item select 1, 0] call EFUNC(common,waitAndExecute);
_result

View File

@ -15,7 +15,7 @@
* Public: Yes
*/
#include "script_component.hpp"
private ["_arr", "_ran", "_i","_speedDial"];
private ["_arr", "_ran", "_i"];
EXPLODE_2_PVT(_this,_unit,_code);
if (_unit getVariable [QGVAR(Dialing),false]) exitWith {};
if !(alive _unit) exitWith {};

View File

@ -14,6 +14,8 @@
* Public: Yes
*/
#include "script_component.hpp"
// IGNORE_PRIVATE_WARNING(_detonators);
private ["_unit", "_items", "_result", "_config"];
_unit = _this select 0;
_items = (items _unit);

View File

@ -16,6 +16,8 @@
* Public: Yes
*/
#include "script_component.hpp"
// IGNORE_PRIVATE_WARNING(_allExplosives,_deadmanExplosives);
private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"];
_unit = _this select 0;
_filter = nil;

View File

@ -14,6 +14,8 @@
* Public: Yes
*/
#include "script_component.hpp"
// IGNORE_PRIVATE_WARNING(_hasExplosives);
private ["_unit", "_result", "_magazines"];
_result = false;
_unit = _this select 0;

View File

@ -14,4 +14,6 @@
* Public: Yes
*/
#include "script_component.hpp"
// IGNORE_PRIVATE_WARNING(_hasPlacedExplosives);
(count (_this call FUNC(getPlacedExplosives)) > 0)

View File

@ -15,6 +15,9 @@
*/
#include "script_component.hpp"
if !(isServer) exitWith {};
private["_activated", "_logic"];
_logic = _this select 0;
_activated = _this select 2;

View File

@ -19,7 +19,7 @@ if (GVAR(pfeh_running)) then {
[QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler);
GVAR(pfeh_running) = false;
};
private ["_mag", "_setup", "_player"];
private ["_setup", "_player", "_dir"];
_setup = GVAR(Setup);
GVAR(Setup) = objNull;
[GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus);

View File

@ -28,7 +28,7 @@ GVAR(Setup) setVariable [QGVAR(class), _class, true];
GVAR(TweakedAngle) = 180;
[QGVAR(Placement),"OnEachFrame", {
private "_player";
private ["_player", "_pos"];
_player = ACE_player;
if (GVAR(placer) != _player) exitWith {
call FUNC(place_Cancel);

View File

@ -16,11 +16,14 @@
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_target);
private["_actionToPlay"];
_target = attachedTo (_target);
_fnc_DefuseTime = {
EXPLODE_2_PVT(_this,_specialist,_target);
private ["_defuseTime"];
_defuseTime = 5;
if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then {
_defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime");