From 4c25bbd3f069767b466a78aa3a23fc1acd93cbde Mon Sep 17 00:00:00 2001 From: vbawol Date: Wed, 31 Aug 2016 19:40:18 -0500 Subject: [PATCH] private array cleanup pt2 --- Sources/epoch_code/compile/EPOCH_consumeItem.sqf | 5 ++++- Sources/epoch_code/compile/EPOCH_lootTrash.sqf | 4 +++- Sources/epoch_code/compile/EPOCH_makeMarker.sqf | 5 ++++- Sources/epoch_code/compile/EPOCH_unitSpawn.sqf | 6 ++++-- Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf | 4 +++- .../epoch_code/compile/building/EPOCH_isBuildAllowed.sqf | 4 +++- Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf | 4 +++- Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf | 5 ++++- Sources/epoch_code/compile/building/EPOCH_staticMove.sqf | 5 ++++- .../compile/environment/EPOCH_client_earthQuake.sqf | 6 ++++-- Sources/epoch_code/compile/functions/EPOCH_itemData.sqf | 6 ++++-- .../epoch_code/compile/missions/EPOCH_mission_accept.sqf | 4 +++- Sources/epoch_code/gui/scripts/EPOCH_InterruptConfig.sqf | 6 ++++-- 13 files changed, 47 insertions(+), 17 deletions(-) diff --git a/Sources/epoch_code/compile/EPOCH_consumeItem.sqf b/Sources/epoch_code/compile/EPOCH_consumeItem.sqf index e3739760..80748ae7 100644 --- a/Sources/epoch_code/compile/EPOCH_consumeItem.sqf +++ b/Sources/epoch_code/compile/EPOCH_consumeItem.sqf @@ -12,7 +12,10 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_consumeItem.sqf */ -private ["_cfgBaseBuilding","_cfgItemInteractions","_type","_magazineSize","_text","_item","_pic","_magazinesAmmoFull","_magazineSizeMax","_pos","_object","_isStorage","_isOk","_buildClass","_interactReturnOnUse","_vehicle","_currentFuel","_canCapacity","_interactAttributes","_fuelCapacity","_newFuel","_removeItem","_vehicles","_transportFuel","_highestDMG","_currentHIT","_currentDMG","_newDMG","_paintCanIndex","_paintCanColor","_msg","_color","_unifiedInteract","_interactOption"]; +//[[[cog import generate_private_arrays ]]] +private ["_buildClass","_buildingCountLimit","_buildingJammerRange","_canCapacity","_cfgBaseBuilding","_cfgItemInteractions","_color","_currentDMG","_currentFuel","_currentHIT","_fuelCapacity","_highestDMG","_interactAttributes","_interactOption","_interactReturnOnUse","_isOk","_isStorage","_magazineSize","_magazineSizeMax","_magazinesAmmoFull","_newDMG","_newFuel","_object","_otherObjects","_output","_paintCanColor","_paintCanIndex","_partCheck","_pos","_removeItem","_transportFuel","_unifiedInteract","_vehicle","_vehicles"]; +//[[[end]]] + EPOCH_InteractedItem params ["_text","_item","_pic"]; _cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig; diff --git a/Sources/epoch_code/compile/EPOCH_lootTrash.sqf b/Sources/epoch_code/compile/EPOCH_lootTrash.sqf index e3856953..f7641b22 100644 --- a/Sources/epoch_code/compile/EPOCH_lootTrash.sqf +++ b/Sources/epoch_code/compile/EPOCH_lootTrash.sqf @@ -12,7 +12,9 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_lootTrash.sqf */ -private["_found", "_return", "_foundLootObject", "_blood", "_foundTerminal", "_index"]; +//[[[cog import generate_private_arrays ]]] +private ["_animal","_animalPos","_animals","_bankTerminal","_blood","_bloodPos","_cfgItemInteractions","_cfgObjectInteractions","_config","_configWorldInteractions","_configWorldName","_destroyTrashObj","_found","_foundLootObject","_foundObjConfig","_foundObjType","_foundTerminal","_foundWorldConfig","_getWorldTypes","_id","_index","_inputWorldTypes","_interactAttributes","_lootAnimalObj","_objects","_output","_randomAIClass","_return","_trashType"]; +//[[[end]]] _return = false; if (diag_tickTime - EPOCH_lastTrash > 2) then { EPOCH_lastTrash = diag_tickTime; diff --git a/Sources/epoch_code/compile/EPOCH_makeMarker.sqf b/Sources/epoch_code/compile/EPOCH_makeMarker.sqf index 47311c89..f7e96722 100644 --- a/Sources/epoch_code/compile/EPOCH_makeMarker.sqf +++ b/Sources/epoch_code/compile/EPOCH_makeMarker.sqf @@ -23,7 +23,10 @@ Returns: */ -_paramres = params [["_trgt", str(diag_tickTime)],["_mPos", position player],["_mShape","ICON"],["_mType","mil_dot"],["_mColor","ColorBlack"],["_mSize",[0.7,0.7]],["_mBrush",""],["_mDir",0],["_mText",""],["_mAlpha",1],["_mName",""]]; +//[[[cog import generate_private_arrays ]]] +private ["_mName","_mrkr"]; +//[[[end]]] +params [["_trgt", str(diag_tickTime)],["_mPos", position player],["_mShape","ICON"],["_mType","mil_dot"],["_mColor","ColorBlack"],["_mSize",[0.7,0.7]],["_mBrush",""],["_mDir",0],["_mText",""],["_mAlpha",1],["_mName",""]]; diag_log format["Epoch: ADMIN: Creating marker at %1 called %2 (Params:%3).", _mPos, _trgt, _paramres]; if(_mName == "")then{_mName = str(_trgt) + str(diag_tickTime);}; diff --git a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf index 587fae68..50825bdf 100644 --- a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf @@ -12,10 +12,12 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf */ -private ["_loop","_unit","_sapperNum","_config","_targetPos","_grp","_driver","_index","_nonJammer","_nonTrader","_jammers","_jammerRange","_restricted","_disableAI"]; +//[[[cog import generate_private_arrays ]]] +private ["_bomb","_config","_currentLimit","_disableAI","_driver","_grp","_index","_jammerRange","_jammers","_loop","_nonJammer","_nonTrader","_nonTraderAIRange","_restricted","_sapperNum","_spawnLimit","_targetPos","_unit","_units"]; +//[[[end]]] params ["_unitClass",["_trgt",player],["_doVariable",false]]; -private _bomb = objNull; +_bomb = objNull; diag_log format["DEBUG: Antagonist %1 Spawning on %2. Do variable: %3.", _unitClass, _trgt, _doVariable]; if(random 100 < 6)then{ diff --git a/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf b/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf index 5b80fa77..39321280 100644 --- a/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf @@ -20,8 +20,10 @@ Returns: OBJECT - Zombie Agent */ +//[[[cog import generate_private_arrays ]]] +private ["_clutterPos","_disableAI","_grave","_unit","_unitClass","_zMax","_zRange","_zedHandle","_zeds"]; +//[[[end]]] params [["_justSpawn",false]]; -private ["_zRange","_disableAI","_unitClass","_unit","_clutterPos","_zedHandle","_zMax"]; _disableAI = {{_this disableAI _x}forEach["TARGET","AUTOTARGET","FSM"];}; _zRange = getNumber (getMissionConfig "CfgEpochRyanZombie" >> "range"); diff --git a/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf b/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf index 84ed4688..3ff5f63f 100644 --- a/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf @@ -22,7 +22,9 @@ Returns: BOOL */ -private ["_cfgBaseBuilding","_buildingJammerRange","_buildingCountLimit","_buildingAllowed","_nearestJammer","_ownedJammerExists","_objectCount","_limitNearby","_restricted","_range","_config","_staticClass","_objType","_simulClass","_bypassJammer","_jammer","_restrictedLocations","_myPosATL"]; +//[[[cog import generate_private_arrays ]]] +private ["_alljammer","_buildingAllowed","_buildingCountLeader","_buildingCountLimit","_buildingCountPerMember","_buildingJammerRange","_bypassJammer","_c","_cfgBaseBuilding","_config","_isAllowed","_jammer","_jammerpergroup","_limitNearby","_maxbuildingheigh","_membercount","_minjammerdistance","_myPosATL","_nearestJammer","_obj","_objType","_objectCount","_ownedJammerExists","_range","_restricted","_restrictedArray","_restrictedLocations","_restrictedLocationsArray","_restrictedLocationsRange","_simulClass","_staticClass","_storagecountLeader","_storagecountPerMember"]; +//[[[end]]] _buildingAllowed = true; _ownedJammerExists = false; diff --git a/Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf b/Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf index 86d4c03c..76154630 100644 --- a/Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf @@ -21,7 +21,9 @@ Returns: BOOL - true if removed */ -private ["_buildingJammerRange","_buildingCountLimit","_buildingAllowed","_nearestJammer","_ownedJammerExists","_jammer","_return","_config","_object","_objType","_targeter","_stability","_removeParts"]; +//[[[cog import generate_private_arrays ]]] +private ["_buildingAllowed","_buildingCountLimit","_buildingJammerRange","_config","_jammer","_nearestJammer","_objType","_ownedJammerExists","_removeParts","_return","_stability","_targeter"]; +//[[[end]]] _buildingAllowed = true; _ownedJammerExists = false; diff --git a/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf b/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf index 30385685..09630fcd 100644 --- a/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf @@ -21,7 +21,10 @@ Returns: NOTHING */ -private ["_simulClassConfig","_energyCost","_allowedSnapObjects","_worldspace","_objSlot","_textureSlot","_newObj","_lastCheckTime","_rejectMove","_nearestObject","_nearestObjectRaw","_distanceNear","_previousDistanceNear","_pOffset","_snapPos","_isSnap","_snapPosition","_snapType","_snapDistance","_prevSnapDistance","_snapPointsPara","_snapPointsPerp","_snapArrayPara","_snapArrayPerp","_pos2","_direction","_vel2","_dir2","_up2","_distance","_playerdistance","_class","_create","_allowedSnapPoints","_snapObjects","_currentTarget","_onContactEH","_offset","_disallowed","_object","_objType","_return","_velocityTransformation","_distanceMod","_oemType","_cfgBaseBuilding"]; +//[[[cog import generate_private_arrays ]]] +private ["_allowedSnapObjects","_allowedSnapPoints","_cfgBaseBuilding","_class","_create","_currentTarget","_dir2","_direction","_disallowed","_distance","_distanceMod","_distanceNear","_energyCost","_isSnap","_lastCheckTime","_nearestObject","_nearestObjectRaw","_newObj","_objSlot","_objType","_object","_oemType","_offset","_onContactEH","_pOffset","_playerdistance","_pos2","_prevSnapDistance","_previousDistanceNear","_rejectMove","_removeParts","_return","_simulClassConfig","_snapArrayPara","_snapArrayPerp","_snapDistance","_snapObjects","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPosition","_snapType","_textureSlot","_up2","_vel2","_velocityTransformation","_worldspace"]; +//[[[end]]] + if !(isNil "EPOCH_simulSwap_Lock") exitWith{}; _object = param [0,objNull]; diff --git a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf index 7bb2fdfa..83a748d5 100644 --- a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf @@ -22,8 +22,11 @@ Returns: NOTHING */ +//[[[cog import generate_private_arrays ]]] +private ["_EPOCH_1","_EPOCH_2","_allowedSnapObjects","_allowedSnapPoints","_arr_snapPoints","_baselineSnapPos","_cfgBaseBuilding","_class","_currentOffSet","_currentPos","_currentTarget","_dir2","_direction","_distance","_energyCost","_ins","_isSnap","_lastCheckTime","_maxHeight","_maxSnapDistance","_nearestObject","_nearestObjects","_numberOfContacts","_objSlot","_objType","_offSet","_offsetZPos","_pOffset","_pos1","_pos1_snap","_pos2","_pos2ATL","_pos2_snap","_pos_snapObj","_rejectMove","_simulClass","_snapChecks","_snapConfig","_snapDistance","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPos1","_snapPosition","_snapType","_stabilityCheck","_up2","_worldspace"]; +//[[[end]]] if !(isNil "EPOCH_simulSwap_Lock") exitWith{}; -private ["_cfgBaseBuilding","_energyCost","_maxHeight","_stabilityCheck","_pos2ATL","_lastCheckTime","_rejectMove","_currentOffSet","_dir2","_up2","_nearestObject","_isSnap","_snapPosition","_snapType","_pOffset","_snapPos","_snapDistance","_snapPos1","_pos_snapObj","_direction","_pos1_snap","_pos2_snap","_ins","_EPOCH_2","_arr_snapPoints","_pos1","_offSet","_snapConfig","_snapPointsPara","_snapPointsPerp","_baselineSnapPos","_distance","_nearestObjects","_EPOCH_1","_pos2","_numberOfContacts","_worldspace","_currentTarget","_offsetZPos","_currentPos","_objSlot","_allowedSnapPoints","_allowedSnapObjects","_objType","_class","_simulClass","_snapChecks","_maxSnapDistance"]; + params [ ["_object",objNull], ["_item",""] diff --git a/Sources/epoch_code/compile/environment/EPOCH_client_earthQuake.sqf b/Sources/epoch_code/compile/environment/EPOCH_client_earthQuake.sqf index c26569ba..bb1f8c95 100644 --- a/Sources/epoch_code/compile/environment/EPOCH_client_earthQuake.sqf +++ b/Sources/epoch_code/compile/environment/EPOCH_client_earthQuake.sqf @@ -21,8 +21,10 @@ Returns: Script handle */ -private ["_intensity","_distance"]; -params [["_epicenter",[0,0,0], [[]]]]; +//[[[cog import generate_private_arrays ]]] +private ["_distance","_intensity"]; +//[[[end]]] +params [["_epicenter",[0,0,0],[[]] ] ]; _distance = player distance _epicenter; _intensity = 1; if (_distance < 250) then { diff --git a/Sources/epoch_code/compile/functions/EPOCH_itemData.sqf b/Sources/epoch_code/compile/functions/EPOCH_itemData.sqf index b3d4b6da..4b19bb03 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_itemData.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_itemData.sqf @@ -24,8 +24,10 @@ Returns: Returns STRING if only one element in second param, otherwise returns ARRAY */ -private ["_single","_arr"]; -params [["_item",""],["_entries",["DisplayName"],[[]]]]; +//[[[cog import generate_private_arrays ]]] +private ["_arr","_data","_displayName","_pic","_single"]; +//[[[end]]] +params [["_item",""],["_entries",["DisplayName"],[[]] ] ]; _single = (count _entries) == 1; _arr = []; { diff --git a/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf b/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf index 1a6dbb82..a0d0c302 100644 --- a/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf +++ b/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf @@ -12,7 +12,9 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf */ -private ["_missionTasks","_selectedMission","_simpleTask","_simpleTaskFSM","_simpleTaskSQF","_simpleTaskFNC","_taskNS","_itemCompile","_fnc_path","_path","_taskControl","_missionAllowed","_missionIndex","_plyrVar"]; +//[[[cog import generate_private_arrays ]]] +private ["_allowTask","_doTask","_fnc_path","_itemCompile","_menuCondition","_miNSTask","_missionAllowed","_missionClasses","_missionIndex","_missionTasks","_nrEnts","_path","_plyrVar","_selectedMission","_simpleTask","_simpleTaskFNC","_simpleTaskFSM","_simpleTaskSQF","_tag","_taskNS","_trader","_uiNSTask"]; +//[[[end]]] _missionIndex = lbCurSel 1500; _missionAllowed = true; //systemChat format ["Mission Acepted: %1",_missionIndex]; diff --git a/Sources/epoch_code/gui/scripts/EPOCH_InterruptConfig.sqf b/Sources/epoch_code/gui/scripts/EPOCH_InterruptConfig.sqf index d40bd625..7e96d2c7 100644 --- a/Sources/epoch_code/gui/scripts/EPOCH_InterruptConfig.sqf +++ b/Sources/epoch_code/gui/scripts/EPOCH_InterruptConfig.sqf @@ -14,8 +14,10 @@ */ #include "\A3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; -private ["_ctrl","_ctrlPos","_name","_color","_icon","_group","_idx","_offset","_cfg","_configs","_idc","_getIDC","_lb","_groupIDC"]; -params [["_display",displayNull,[displayNull]]]; +//[[[cog import generate_private_arrays ]]] +private ["_cfg","_color","_configs","_ctrl","_ctrlPos","_getIDC","_group","_groupIDC","_icon","_idc","_idx","_lb","_name","_offset"]; +//[[[end]]] +params [["_display",displayNull,[displayNull] ] ]; _offset = if (isServer) then {40 * GUI_GRID_W + GUI_GRID_X;} else { if (getNumber (getMissionConfig "enableDebugConsole") > 0) then {