diff --git a/addons/csw/dev/checkStaticWeapons.sqf b/addons/csw/dev/checkStaticWeapons.sqf index 7d9917daa7..137dc95334 100644 --- a/addons/csw/dev/checkStaticWeapons.sqf +++ b/addons/csw/dev/checkStaticWeapons.sqf @@ -16,7 +16,7 @@ private _inherited = []; private _config = _x; private _configEnabled = (getNumber (_config >> QUOTE(ADDON) >> "enabled")) == 1; if (_configEnabled) then { - private _configExplicit = (count configProperties [_config, "configName _x == 'ace_csw'", false]) == 1; + private _configExplicit = (count configProperties [_config, toString {configName _x == QUOTE(ADDON)}, false]) == 1; if (_configExplicit) then { _explicitBases pushBack (configName _config); _inherited pushBack []; @@ -43,8 +43,8 @@ private _inherited = []; INFO("------ Logging static magazines with no carry version -------"); private _hash = createHashMap; -// private _logAll = true; // logs all possible weapon magazines (even if not used in a static weapon) -private _logAll = false; +private _logAll = false; // logs all possible weapon magazines (even if not used in a static weapon) when set to true + { private _vehicleType = configName _x; private _turretConfig = [_vehicleType, [0]] call CBA_fnc_getTurret; diff --git a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf index 5230fccf52..f3a6bbde5f 100644 --- a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf +++ b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Helper function for ace_rearm; Gets magazines that should be loaded by csw + * Helper function for ace_rearm; Gets magazines that should be loaded by csw. * * Arguments: - * 0: Vehicle - * 1: Specific Turret or pass bool to check all turrets (default: true) + * 0: CSW + * 1: Specific Turret or pass bool to check all turrets (default: true) * * Return Value: * [0: compatible veh mags, 1: carry mags] diff --git a/addons/csw/functions/fnc_ai_handleFired.sqf b/addons/csw/functions/fnc_ai_handleFired.sqf index d92e517091..6f7a645257 100644 --- a/addons/csw/functions/fnc_ai_handleFired.sqf +++ b/addons/csw/functions/fnc_ai_handleFired.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Handles AI Fired EH + * Handles AI Fired EH. * * Arguments: * Fired EH diff --git a/addons/csw/functions/fnc_ai_handleGetIn.sqf b/addons/csw/functions/fnc_ai_handleGetIn.sqf index f14a4ccbc7..14b4453f53 100644 --- a/addons/csw/functions/fnc_ai_handleGetIn.sqf +++ b/addons/csw/functions/fnc_ai_handleGetIn.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: Grim - * Handles AI GetIn on an empty weapon + * Author: LinkIsGrim + * Handles AI GetIn on an empty CSW. * * Arguments: * GetIn EH diff --git a/addons/csw/functions/fnc_ai_reload.sqf b/addons/csw/functions/fnc_ai_reload.sqf index 4d6234f94a..288d718a2f 100644 --- a/addons/csw/functions/fnc_ai_reload.sqf +++ b/addons/csw/functions/fnc_ai_reload.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror, modified by Grim - * Handles AI reloading + * Author: PabstMirror, LinkIsGrim + * Handles AI reloading. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Gunner * 2: Weapon * 3: Magazine (default: "") @@ -15,7 +15,7 @@ * Public: No */ -params ["_staticWeapon", "_gunner", "_weapon", ["_magazine", ""]]; +params ["_vehicle", "_gunner", "_weapon", ["_magazine", ""]]; private _turretPath = [_gunner] call EFUNC(common,getTurretIndex); private _reloadSource = objNull; @@ -24,7 +24,7 @@ private _reloadNeededAmmo = -1; private _cfgMagGroups = configFile >> QGVAR(groups); -private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { +private _nearSupplies = [_gunner] + ((_vehicle nearSupplies 10) select { isNull (group _x) || {!([_x] call EFUNC(common,isPlayer)) && {[side group _gunner, side group _x] call BIS_fnc_sideIsFriendly}} }); @@ -49,7 +49,7 @@ private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { private _xWeaponMag = _x; { if ((getNumber (_cfgMagGroups >> _x >> _xWeaponMag)) == 1) then { - private _loadInfo = [_staticWeapon, _turretPath, _x, _xSource] call FUNC(reload_canLoadMagazine); + private _loadInfo = [_vehicle, _turretPath, _x, _xSource] call FUNC(reload_canLoadMagazine); if (_loadInfo select 0) then { _reloadMag = _x; _reloadSource = _xSource; @@ -81,16 +81,16 @@ if (_bestAmmoToSend == -1) exitWith {ERROR("No ammo");}; [_reloadSource, _reloadMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); private _timeToLoad = 1; -if (!isNull(configOf _staticWeapon >> QUOTE(ADDON) >> "ammoLoadTime")) then { - _timeToLoad = getNumber(configOf _staticWeapon >> QUOTE(ADDON) >> "ammoLoadTime"); +if (!isNull(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime")) then { + _timeToLoad = getNumber(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime"); }; TRACE_1("Reloading in progress",_timeToLoad); [{ - params ["_staticWeapon", "_turretPath", "_gunner", "_reloadMag", "_bestAmmoToSend"]; - if ((!alive _staticWeapon) || {!alive _gunner} || {(_staticWeapon distance _gunner) > 10}) exitWith {TRACE_1("invalid state",_this);}; + params ["_vehicle", "_turretPath", "_gunner", "_reloadMag", "_bestAmmoToSend"]; + if ((!alive _vehicle) || {!alive _gunner} || {(_vehicle distance _gunner) > 10}) exitWith {TRACE_1("invalid state",_this);}; // Reload the static weapon - TRACE_5("calling addTurretMag event",_staticWeapon,_turretPath,_gunner,_reloadMag,_bestAmmoToSend); + TRACE_5("calling addTurretMag event",_vehicle,_turretPath,_gunner,_reloadMag,_bestAmmoToSend); [QGVAR(addTurretMag), _this] call CBA_fnc_globalEvent; -}, [_staticWeapon, _turretPath, _gunner, _reloadMag, _bestAmmoToSend], _timeToLoad] call CBA_fnc_waitAndExecute; +}, [_vehicle, _turretPath, _gunner, _reloadMag, _bestAmmoToSend], _timeToLoad] call CBA_fnc_waitAndExecute; diff --git a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf index 65dd81cc41..6dd58fe4fb 100644 --- a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf @@ -1,14 +1,14 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if you can deploy a weapon on the tripod + * Checks if you can deploy a weapon on the tripod. * * Arguments: - * 0: Target Tripod + * 0: Target * 1: Player * * Return Value: - * Wether or not you can deploy the weapon + * Whether or not you can deploy the weapon * * Example: * [cursorObject, player] call ace_csw_fnc_assemble_canDeployWeapon diff --git a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf index 0d508bfa89..3228373b40 100644 --- a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf @@ -1,23 +1,23 @@ #include "..\script_component.hpp" /* * Author: tcvm - * If the CSW is mounted or in use this will not allow you to dismount the weapon + * If the CSW is mounted or in use this will not allow you to dismount the weapon. * * Arguments: - * 0: Static Weapon + * 0: CSW * * Return Value: - * Can Dismount + * Can dismount weapon * * Example: - * [cursorObject] call ace_csw_fnc_assemble_canPickupWeapon + * cursorObject call ace_csw_fnc_assemble_canPickupWeapon * * Public: No */ -params ["_staticWeapon"]; +params ["_vehicle"]; // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] -private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]); +private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]); -_assemblyMode && {alive _staticWeapon} && {((crew _staticWeapon) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return +_assemblyMode && {alive _vehicle} && {((crew _vehicle) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return diff --git a/addons/csw/functions/fnc_assemble_deployTripod.sqf b/addons/csw/functions/fnc_assemble_deployTripod.sqf index 29cc4b5876..c69d618066 100644 --- a/addons/csw/functions/fnc_assemble_deployTripod.sqf +++ b/addons/csw/functions/fnc_assemble_deployTripod.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Deploys the tripod + * Deploys the tripod. * * Arguments: * 0: Unit @@ -10,7 +10,7 @@ * None * * Example: - * [player] call ace_csw_fnc_assemble_deployTripod + * player call ace_csw_fnc_assemble_deployTripod * * Public: No */ @@ -34,7 +34,7 @@ _args params ["_player", "_secondaryWeaponClassname", "_secondaryWeaponInfo"]; TRACE_3("deployTripod finish",_player,_secondaryWeaponClassname,_secondaryWeaponInfo); - private _tripodClassname = getText(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); + private _tripodClassname = getText (configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); // Create a tripod private _cswTripod = createVehicle [_tripodClassname, [0, 0, 0], [], 0, "NONE"]; @@ -96,6 +96,6 @@ } forEach _secondaryWeaponInfo; }; - private _deployTime = getNumber(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); + private _deployTime = getNumber (configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); [TIME_PROGRESSBAR(_deployTime), [_player, _secondaryWeaponClassname, _secondaryWeaponInfo], _onFinish, _onFailure, LLSTRING(PlaceTripod_progressBar)] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index 974bf03431..a0e0acdd28 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Deploys the current CSW + * Deploys the current CSW. * * Arguments: * 0: Target - * 1: Unit + * 1: Player * 2: Args * 3: Action Data * diff --git a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf index 85b1346415..f98978195d 100644 --- a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Modifies interaction for deploying weapon + * Modifies interaction for deploying weapon. * * Arguments: * 0: Target @@ -21,7 +21,7 @@ params ["_target", "_player", "", "_actionData"]; private _carryWeaponClassname = secondaryWeapon _player; -private _assembleTo = (getText(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> (typeOf _target))); +private _assembleTo = getText (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target); private _icon = getText (configFile >> "CfgVehicles" >> _assembleTo >> "picture"); TRACE_2("",_assembleTo,_icon); diff --git a/addons/csw/functions/fnc_assemble_pickupTripod.sqf b/addons/csw/functions/fnc_assemble_pickupTripod.sqf index 0996c0f3d3..c09400a87f 100644 --- a/addons/csw/functions/fnc_assemble_pickupTripod.sqf +++ b/addons/csw/functions/fnc_assemble_pickupTripod.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Picks up the tripod and adds it to the player launcher slot + * Picks up the tripod and adds it to the player launcher slot. * * Arguments: * 0: Tripod - * 1: Unit + * 1: Player * * Return Value: * None @@ -56,7 +56,7 @@ if (isNull _weaponHolder || {_tripodPos distance _weaponHolder > 2}) then { _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // Places object on surface below }; _weaponHolder addWeaponCargoGlobal [_tripodClassname, 1]; diff --git a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf index 468f385efa..65dc5fa740 100644 --- a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Dismounts the weapon from the tripod and drops its backpack beside + * Dismounts the weapon from the tripod and drops its backpack beside. * * Arguments: - * 0: Static Weapon - * 1: Unit + * 0: CSW + * 1: Player * * Return Value: * None @@ -17,10 +17,10 @@ */ [{ - params ["_staticWeapon", "_player"]; - TRACE_2("assemble_pickupWeapon",_staticWeapon,_player); + params ["_vehicle", "_player"]; + TRACE_2("assemble_pickupWeapon",_vehicle,_player); - private _weaponConfig = configOf _staticWeapon >> QUOTE(ADDON); + private _weaponConfig = configOf _vehicle >> QUOTE(ADDON); private _carryWeaponClassname = getText (_weaponConfig >> "disassembleWeapon"); if (!isClass (configFile >> "CfgWeapons" >> _carryWeaponClassname)) exitWith { @@ -37,15 +37,15 @@ private _onDisassembleFunc = getText (_weaponConfig >> "disassembleFunc"); private _pickupTime = getNumber (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "pickupTime"); - TRACE_4("",typeOf _staticWeapon,_carryWeaponClassname,_turretClassname,_pickupTime); + TRACE_4("",typeOf _vehicle,_carryWeaponClassname,_turretClassname,_pickupTime); private _onFinish = { params ["_args"]; - _args params ["_staticWeapon", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; - TRACE_4("disassemble finish",_staticWeapon,_player,_carryWeaponClassname,_turretClassname); + _args params ["_vehicle", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; + TRACE_4("disassemble finish",_vehicle,_player,_carryWeaponClassname,_turretClassname); - private _weaponPos = (getPosATL _staticWeapon) vectorAdd [0, 0, 0.1]; - private _weaponDir = getDir _staticWeapon; + private _weaponPos = (getPosATL _vehicle) vectorAdd [0, 0, 0.1]; + private _weaponDir = getDir _vehicle; private _carryWeaponMag = []; private _carryWeaponMags = compatibleMagazines _carryWeaponClassname; @@ -64,7 +64,7 @@ TRACE_2("Removing ammo",_xMag,_carryMag); [_player, _carryMag, _xAmmo] call FUNC(reload_handleReturnAmmo); }; - } forEach (magazinesAllTurrets _staticWeapon); + } forEach (magazinesAllTurrets _vehicle); if (_turretClassname isNotEqualTo "") then { private _cswTripod = createVehicle [_turretClassname, [0, 0, 0], [], 0, "NONE"]; @@ -76,7 +76,7 @@ _cswTripod setVelocity [0, 0, -0.05]; _cswTripod setVectorUp (surfaceNormal _weaponPos); }, [_cswTripod, _weaponDir, _weaponPos]] call CBA_fnc_execNextFrame; - [_cswTripod, _staticWeapon] call (missionNamespace getVariable _onDisassembleFunc); + [_cswTripod, _vehicle] call (missionNamespace getVariable _onDisassembleFunc); }; [{ @@ -99,7 +99,7 @@ // Create a new weapon holder (don't try to get an existing one, as no guarantee where it could be) private _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // Places object on surface below _weaponHolder addWeaponWithAttachmentsCargoGlobal [[_carryWeaponClassname, "", "", "", _carryWeaponMag, [], ""], 1]; }, [_player, _weaponPos, _carryWeaponClassname, _carryWeaponMag, _turretClassname]] call CBA_fnc_execNextFrame; @@ -108,23 +108,23 @@ // Eject dead units (all crew are dead or UAV at this point, otherwise condition would have failed), but ignore UAV units { if (unitIsUAV _x) then { - _staticWeapon deleteVehicleCrew _x; + _vehicle deleteVehicleCrew _x; } else { moveOut _x; }; - } forEach (crew _staticWeapon); + } forEach (crew _vehicle); - deleteVehicle _staticWeapon; + deleteVehicle _vehicle; LOG("end"); }; private _condition = { params ["_args"]; - _args params ["_staticWeapon"]; + _args params ["_vehicle"]; - _staticWeapon call FUNC(assemble_canPickupWeapon) + _vehicle call FUNC(assemble_canPickupWeapon) }; - [TIME_PROGRESSBAR(_pickupTime), [_staticWeapon, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_pickupTime), [_vehicle, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_canDeployTripod.sqf b/addons/csw/functions/fnc_canDeployTripod.sqf index 8969758e4d..9eb7f0a133 100644 --- a/addons/csw/functions/fnc_canDeployTripod.sqf +++ b/addons/csw/functions/fnc_canDeployTripod.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if the unit can deploy a tripod + * Checks if the player can deploy the tripod. * * Arguments: - * 0: Unit + * 0: Player * * Return Value: * Can deploy @@ -15,8 +15,8 @@ * Public: No */ -params ["_unit"]; +params ["_player"]; -private _secondaryWeapon = secondaryWeapon _unit; +private _secondaryWeapon = secondaryWeapon _player; _secondaryWeapon != "" && {getText (configFile >> "CfgWeapons" >> _secondaryWeapon >> QUOTE(ADDON) >> "type") == "mount"} // return diff --git a/addons/csw/functions/fnc_canGetIn.sqf b/addons/csw/functions/fnc_canGetIn.sqf index 16446c4fb2..9e017c16ef 100644 --- a/addons/csw/functions/fnc_canGetIn.sqf +++ b/addons/csw/functions/fnc_canGetIn.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if it's possible to get in the CSW + * Checks if it's possible to get in the CSW. * * Arguments: - * 0: Vehicle + * 0: CSW * * Return Value: * None diff --git a/addons/csw/functions/fnc_canPickupTripod.sqf b/addons/csw/functions/fnc_canPickupTripod.sqf index 2ec3b065da..bf25b5a9e8 100644 --- a/addons/csw/functions/fnc_canPickupTripod.sqf +++ b/addons/csw/functions/fnc_canPickupTripod.sqf @@ -1,17 +1,16 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if the unit can pickup the tripod + * Checks if the player can pickup the tripod. * * Arguments: * 0: Tripod - * 1: Unit (not used) * * Return Value: * Can pickup * * Example: - * [cursorObject, player] call ace_csw_fnc_canPickupTripod + * cursorObject call ace_csw_fnc_canPickupTripod * * Public: No */ diff --git a/addons/csw/functions/fnc_getCarryMagazine.sqf b/addons/csw/functions/fnc_getCarryMagazine.sqf index 81e07c6f10..3d94ca2fe1 100644 --- a/addons/csw/functions/fnc_getCarryMagazine.sqf +++ b/addons/csw/functions/fnc_getCarryMagazine.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror, Dystopian - * Gets magazine that the player can carry, suitable to vehicle magazine + * Gets magazine that the player can carry, suitable to vehicle magazine. * * Arguments: * 0: Vehicle Magazine diff --git a/addons/csw/functions/fnc_getLoadActions.sqf b/addons/csw/functions/fnc_getLoadActions.sqf index e505c7f50f..2b28d2dbd6 100644 --- a/addons/csw/functions/fnc_getLoadActions.sqf +++ b/addons/csw/functions/fnc_getLoadActions.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets sub actions for what the unit can load into the CSW + * Gets sub actions for what the player can load into the CSW. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Unit * * Return Value: @@ -35,7 +35,7 @@ private _condition = { ([_target, _turretPath, _carryMag, _magSource] call FUNC(reload_canLoadMagazine)) select 0 }; -private _cfgMagazines = configFile >> "CfgMagazines"; // micro-optimization +private _cfgMagazines = configFile >> "CfgMagazines"; // Micro-optimization private _actions = []; { _x params ["_carryMag", "", "_loadInfo"]; diff --git a/addons/csw/functions/fnc_initVehicle.sqf b/addons/csw/functions/fnc_initVehicle.sqf index 2d7241029f..80ff071f10 100644 --- a/addons/csw/functions/fnc_initVehicle.sqf +++ b/addons/csw/functions/fnc_initVehicle.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Initializes CSW systems on vehicle + * Initializes CSW systems on vehicle. * * Arguments: * 0: Vehicle @@ -78,7 +78,7 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; [_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith) }; - private _childenCode = { + private _childrenCode = { BEGIN_COUNTER(getActions); // can remove for final release private _ret = (call FUNC(getLoadActions)) + (call FUNC(getUnloadActions)); END_COUNTER(getActions); @@ -86,10 +86,10 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { }; if (_configEnabled && {_magazineLocation != ""}) then { private _positionCode = compile _magazineLocation; - private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); _ammoActionPath = [_typeOf, 0, [], _ammoAction] call EFUNC(interact_menu,addActionToClass); } else { - private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode] call EFUNC(interact_menu,createAction); + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode] call EFUNC(interact_menu,createAction); _ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass); }; diff --git a/addons/csw/functions/fnc_proxyWeapon.sqf b/addons/csw/functions/fnc_proxyWeapon.sqf index fedd1d412b..42773dc7ec 100644 --- a/addons/csw/functions/fnc_proxyWeapon.sqf +++ b/addons/csw/functions/fnc_proxyWeapon.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles the use of proxy weapons to bypass engine reload times + * Handles the use of proxy weapons to fix engine-reload times. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Proxy weapon needed * 2: Weapon should be emptied diff --git a/addons/csw/functions/fnc_reload_canLoadMagazine.sqf b/addons/csw/functions/fnc_reload_canLoadMagazine.sqf index 70c673299a..d4049706bd 100644 --- a/addons/csw/functions/fnc_reload_canLoadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_canLoadMagazine.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror &tcvm - * Tests if unit can load a magazine into a static weapon. + * Author: PabstMirror, tcvm + * Tests if unit can load a magazine into a CSW. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Carryable Magazine - * 3: Supplier + * 3: Supplier (default: objNull) * * Return Value: - * [CanLoad, LoadedMag, AmmoNeeded, IsBeltLinking] + * [Can Load , Loaded Mag , Ammo Needed , Is Belt Linking ] * * Example: * [cursorObject, [0], "ACE_csw_100Rnd_127x99_mag_red", player] call ace_csw_fnc_reload_canLoadMagazine @@ -28,7 +28,7 @@ if (!alive _vehicle) exitWith { _return }; // Verify holder has carry magazine if ( (!isNull _magSource) && - {!((_magSource isKindOf "Bag_Base") || {_magSource isKindOf "ContainerSupply"})} && // hacky workaround for magazines within dropped backpacks + {!((_magSource isKindOf "Bag_Base") || {_magSource isKindOf "ContainerSupply"})} && // Hacky workaround for magazines within dropped backpacks { ((_vehicle distance _magSource) > 10) || {((magazineCargo _magSource) findIf {_x == _carryMag}) == -1} @@ -42,7 +42,7 @@ private _cfgGroupsCarryMag = configFile >> QGVAR(groups) >> _carryMag; private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); if (_desiredAmmo == 0) then { _desiredAmmo = 100; }; -private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "count"); // assume it needs full carry mag +private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "count"); // Assume it needs full carry mag private _loadedMag = ""; private _isBeltLinking = false; @@ -62,7 +62,7 @@ scopeName "main"; }; private _maxMagazineAmmo = _desiredAmmo min getNumber (_cfgMagazines >> _xMag >> "count"); if (_xAmmo >= _maxMagazineAmmo) exitWith { - [false, _loadedMag, -6, false] breakOut "main"; // Already at capicity + [false, _loadedMag, -6, false] breakOut "main"; // Already at capacity }; _ammoNeeded = _maxMagazineAmmo - _xAmmo; _isBeltLinking = true; diff --git a/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf b/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf index 4e03625a29..d7899e655a 100644 --- a/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Tests if unit can unload a magazine from a static weapon. + * Tests if unit can unload a magazine from a CSW. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Player * 3: Carryable Magazine diff --git a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf index 724ee4d09c..861f70350d 100644 --- a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf +++ b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf @@ -1,15 +1,15 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets magazines that the player is carrying that can be loaded into the static weapon + * Gets nearby magazines that can be loaded into the CSW. * * Arguments: - * 0: Vehicle - * 1: Player + * 0: CSW + * 1: Unit * * Return Value: * Mags - * [Carry Magazine , Turret Path , Load Info , Magazine Source ] + * [Carry Magazine , Turret Path , Load Info , Magazine Source ] * * Example: * [cursorObject, player] call ace_csw_fnc_reload_getLoadableMagazines diff --git a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf index 6b5b77efee..3682651aac 100644 --- a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf +++ b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf @@ -4,7 +4,7 @@ * Finds the best vehicle magazines to create from a carryable magazine for a given weapon. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Magazine that is carryable * diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index c752f76f59..389ae699a4 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles adding ammo to a turret - * Called from a global event but only runs where turret is local + * Handles adding ammo to a turret. + * Called from a global event but only runs where turret is local. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Source of magazine * 3: Vehicle Magazine diff --git a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf index 51036b525a..dccc9b16d4 100644 --- a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Handles removing ammo from a turret - * Called from a global event but only runs where turret is local + * Handles removing ammo from a turret. + * Called from a global event but only runs where turret is local. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path - * 2: Magainze Unit Can Carry + * 2: Magazine Unit Can Carry * 3: Magazine To Remove From Static * 4: Unit or container to unload to * diff --git a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf index 864bb2ab6f..009a39c0d1 100644 --- a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf +++ b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: tcvm and PabstMirror - * Handles returned ammo (either from unloading or leftovers from linking) + * Author: tcvm, PabstMirror + * Handles returned ammo (either from unloading or leftovers from linking). * * Arguments: * 0: Man or Vehicle diff --git a/addons/csw/functions/fnc_reload_loadMagazine.sqf b/addons/csw/functions/fnc_reload_loadMagazine.sqf index 07db0fb146..ac6e992fb8 100644 --- a/addons/csw/functions/fnc_reload_loadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_loadMagazine.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Loads a magazine into a static weapon from a magazine carried by or next to the player. + * Loads a magazine into a CSW from a magazine carried by or next to the player. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Unit Carried Magazine * 3: Magazine source diff --git a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf index 98200840a3..1c27a494d5 100644 --- a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf @@ -1,11 +1,12 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Dumps ammo to container + * Dumps ammo to container. * * Arguments: - * 0: Weapon + * 0: CSW * 1: Using advanced assembly + * 2: Empty weapon * * Return Value: * None @@ -16,11 +17,11 @@ * Public: No */ -params ["_staticWeapon", "_assemblyMode", "_emptyWeapon"]; -TRACE_3("staticWeaponInit_unloadExtraMags",_staticWeapon,_assemblyMode,_emptyWeapon); +params ["_vehicle", "_assemblyMode", "_emptyWeapon"]; +TRACE_3("staticWeaponInit_unloadExtraMags",_vehicle,_assemblyMode,_emptyWeapon); if (!_assemblyMode) exitWith {}; -private _desiredAmmo = getNumber (configOf _staticWeapon >> QUOTE(ADDON) >> "desiredAmmo"); +private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); private _storeExtraMagazines = GVAR(handleExtraMagazines); if (_emptyWeapon) then { _desiredAmmo = 0; @@ -56,41 +57,41 @@ private _containerMagazineCount = []; } else { if ((_xMag select [0,4]) != "fake") then { WARNING_1("Unable to unload [%1] - No matching carry mag",_xMag); }; }; -} forEach (magazinesAllTurrets _staticWeapon); +} forEach (magazinesAllTurrets _vehicle); TRACE_1("Remove all loaded magazines",_magsToRemove); { - _staticWeapon removeMagazinesTurret _x; + _vehicle removeMagazinesTurret _x; if ((_loadedMagazineInfo select [0,2]) isEqualTo _x) then { TRACE_1("Re-add the starting mag",_loadedMagazineInfo); - _staticWeapon addMagazineTurret _loadedMagazineInfo; + _vehicle addMagazineTurret _loadedMagazineInfo; }; } forEach _magsToRemove; -private _secondaryWeaponMagazines = _staticWeapon getVariable [QGVAR(secondaryWeaponMagazines), []]; +private _secondaryWeaponMagazines = _vehicle getVariable [QGVAR(secondaryWeaponMagazines), []]; if (_secondaryWeaponMagazines isNotEqualTo []) then { // Check if the static weapon can take magazines - private _turret = (allTurrets _staticWeapon) param [0, []]; - private _compatibleMagazinesTurret = flatten ((_staticWeapon weaponsTurret _turret) apply {compatibleMagazines _x}); + private _turret = (allTurrets _vehicle) param [0, []]; + private _compatibleMagazinesTurret = flatten ((_vehicle weaponsTurret _turret) apply {compatibleMagazines _x}); private _container = objNull; { - private _vehicleMag = [_staticWeapon, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); + private _vehicleMag = [_vehicle, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); TRACE_3("Re-add previous mag",_x select 0,_turret,_vehicleMag); // If the magazine can be added to the static weapon, do it now if (_vehicleMag in _compatibleMagazinesTurret) then { - _staticWeapon addMagazineTurret [_vehicleMag, _turret, _x select 1]; + _vehicle addMagazineTurret [_vehicleMag, _turret, _x select 1]; } else { // Find a suitable container to place items in if necessary if (isNull _container) then { - _container = (nearestObjects [_staticWeapon, ["GroundWeaponHolder"], 10]) param [0, objNull]; + _container = (nearestObjects [_vehicle, ["GroundWeaponHolder"], 10]) param [0, objNull]; // Create ammo storage container if (isNull _container) then { - _container = createVehicle ["GroundWeaponHolder", getPosATL _staticWeapon, [], 0, "NONE"]; + _container = createVehicle ["GroundWeaponHolder", getPosATL _vehicle, [], 0, "NONE"]; }; }; @@ -99,12 +100,12 @@ if (_secondaryWeaponMagazines isNotEqualTo []) then { }; } forEach _secondaryWeaponMagazines; - _staticWeapon setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; + _vehicle setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; }; if (_storeExtraMagazines) then { TRACE_1("saving extra mags to container",_containerMagazineCount); { - [_staticWeapon, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo); + [_vehicle, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo); } forEach _containerMagazineClassnames; };