Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions addons/ai/functions/fnc_garrison.sqf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we deprecate this maybe? I think most people who care are going to use their preferred AI mod's garrison function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ace_zeus_fnc_moduleGarrison uses this
as far as I know it works ok, so I would prefer to keep it

Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ private _currentUnitMoveList = missionNamespace getVariable [QGVAR(garrison_unit
if (_startingPos isEqualTo [0,0,0]) exitWith {
TRACE_1("fnc_garrison: StartingPos error",_startingPos);
[LSTRING(GarrisonInvalidPosition)] call EFUNC(common,displayTextStructured);
_unitsArray
};

if (_unitsArray isEqualTo [] || {isNull (_unitsArray select 0)}) exitWith {
TRACE_1("fnc_garrison: Units error",_unitsArray);
[LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured);
_unitsArray
};

private _buildings = nearestObjects [_startingPos, _buildingTypes, ([_fillingRadius, 50] select (_fillingRadius < 50))];
Expand All @@ -46,6 +48,7 @@ if (_fillingRadius >= 50) then {
if (_buildings isEqualTo []) exitWith {
TRACE_1("fnc_garrison: Building error",_buildings);
[LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured);
_unitsArray
};

private _buildingsIndex = [];
Expand Down
2 changes: 1 addition & 1 deletion addons/artillerytables/functions/fnc_adjustFire.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ params ["_gunPos", "_targetPos", "_adjustEast", "_adjustNorth", "_adjustUp", "_m
//DEFAULT_AIR_FRICTION == -0.00006
//MK6_82mm_AIR_FRICTION == -0.0001

private _resultPos = [_adjustEast + _targetPos select 0, _adjustNorth + _targetPos select 1, _adjustUp + _targetPos select 2];
private _resultPos = _targetPos vectorAdd [_adjustEast, _adjustNorth, _adjustUp];

private _returns = [_gunPos, _resultPos, _muzzleVelocity, _highAngle, _airFriction, _temperature, _airDensity, _windDir, _windSpeed] call FUNC(calculateSolution);

Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_removeSyncedEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ if !(_name in GVAR(syncedEvents)) exitWith {
private _data = GVAR(syncedEvents) get _name;
_data params ["", "", "", "_eventId"];

[_eventId] call CBA_fnc_removeEventHandler;
[_name, _eventId] call CBA_fnc_removeEventHandler;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function has never worked, we could also just remove it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecate, remove in next major version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's not doing much harm
I was more worried it could cause problems if people had been calling and it starts working
but I guess we'll find out

GVAR(syncedEvents) deleteAt _name;
1 change: 1 addition & 0 deletions addons/common/functions/fnc_requestSyncedEvent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ params ["_eventName"];
if (isServer) exitWith {false};

["ACEs", [_eventName, ACE_player]] call CBA_fnc_serverEvent;
true
1 change: 1 addition & 0 deletions addons/common/functions/fnc_syncedEvent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ if !(_name in GVAR(syncedEvents)) exitWith {
private _eventData = [_name, _args, _ttl];

["ACEe", _eventData] call CBA_fnc_globalEvent;
true
2 changes: 1 addition & 1 deletion addons/frag/functions/fnc_frago.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ if (GVAR(reflectionsEnabled)) then {
if (_fragCount > _maxFrags) exitWith {};
Comment thread
LinkIsGrim marked this conversation as resolved.
} forEach _targets;
TRACE_1("targeted",_fragCount);
if (_fragCount > _maxFrags) exitWith {};
if (_fragCount > _maxFrags) exitWith { _fragCount };
private _randomCount = ceil ((_maxFrags - _fragCount) * 0.35);
TRACE_1("",_randomCount);
private _sectorSize = 360 / (_randomCount max 1);
Expand Down
4 changes: 2 additions & 2 deletions addons/interaction/functions/fnc_getGlassDoor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* 2: Door name <STRING>
*
* Return Value:
* 0: Door Name <STRING>
* 0: Door Name <STRING or NIL>
*
* Example:
* [player, target] call ace_interaction_fnc_getGlassDoor
Expand Down Expand Up @@ -61,6 +61,6 @@ private _lowestDistance = 0;
} forEach _doorPos;

// Check if we have a door or if it is the glass part
if ((isNil "_door") || ((_door find "glass") != -1)) exitWith {};
if ((isNil "_door") || ((_door find "glass") != -1)) exitWith {}; // line has never worked?
Comment thread
PabstMirror marked this conversation as resolved.

_door
3 changes: 2 additions & 1 deletion addons/medical/functions/fnc_setUnconscious.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* 3: Force wakeup at given time if vitals are stable <BOOL> (default: false)
*
* Return Value:
* Success? <BOOL>
* Success? <BOOL> or <NIL> if called before settings are initialized
*
* Example:
* [bob, true] call ace_medical_fnc_setUnconscious;
Expand All @@ -22,6 +22,7 @@
// only run this after the settings are initialized
if !(EGVAR(common,settingsInitFinished)) exitWith {
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setUnconscious), _this];
nil
};

params [["_unit", objNull, [objNull]], ["_knockOut", true, [false]], ["_minWaitingTime", 0, [0]], ["_forcedWakup", false, [false]]];
Expand Down
3 changes: 2 additions & 1 deletion addons/medical_treatment/functions/fnc_treatment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* 3: Treatment <STRING>
*
* Return Value:
* Treatment Started <BOOL>
* Treatment Started <BOOL> or <NIL> if cursor menu is open
*
* Example:
* [player, cursorObject, "Head", "BasicBandage"] call ace_medical_treatment_fnc_treatment
Expand All @@ -23,6 +23,7 @@ params ["_medic", "_patient", "_bodyPart", "_classname"];
// Delay by a frame if cursor menu is open to prevent progress bar failing
if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened), false]) exitWith {
[FUNC(treatment), _this] call CBA_fnc_execNextFrame;
nil
};

if !(call FUNC(canTreat)) exitWith {false};
Expand Down
2 changes: 2 additions & 0 deletions addons/slideshow/functions/fnc_createSlideshow.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ params [
// Verify data
if (_objects isEqualTo []) exitWith {
ERROR("Slideshow Objects field must NOT be empty!");
-1
};
if (count _images != count _names || {_images isEqualTo []} || {_names isEqualTo []}) exitWith {
ERROR("Slideshow Images or Names fields must NOT be empty and must have equal number of items!");
-1
};

// If no controllers use objects as controllers
Expand Down
3 changes: 2 additions & 1 deletion addons/spectator/functions/fnc_updateCameraModes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* 1: Camera modes to remove <ARRAY>
*
* Return Value:
* Available camera modes <ARRAY>
* Available camera modes <ARRAY> or <NIL> if called before settings are initialized
*
* Example:
* [[0], [1,2]] call ace_spectator_fnc_updateCameraModes
Expand All @@ -24,6 +24,7 @@

if !(EGVAR(common,settingsInitFinished)) exitWith {
EGVAR(common,runAtSettingsInitialized) pushBack [DFUNC(updateCameraModes),_this];
nil
};

params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]];
Expand Down
3 changes: 2 additions & 1 deletion addons/spectator/functions/fnc_updateVisionModes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* 1: Vision modes to remove <ARRAY>
*
* Return Value:
* Available vision modes <ARRAY>
* Available vision modes <ARRAY> or <NIL> if called before settings are initialized
*
* Example:
* [[0], [1,2]] call ace_spectator_fnc_updateVisionModes
Expand All @@ -32,6 +32,7 @@

if !(EGVAR(common,settingsInitFinished)) exitWith {
EGVAR(common,runAtSettingsInitialized) pushBack [DFUNC(updateVisionModes),_this];
nil
};

params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]];
Expand Down
2 changes: 1 addition & 1 deletion addons/spike/functions/fnc_camera_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ params ["_projectile", "_cameraArray", "_shooter", "_switchOnFireInit"];
_cameraArray params ["_enabled", "_fovLevels", "_initialFOV", "_thermalTypes", "_initialThermalType", "_switchOnFire", "_lerpFOV", "_fovChangeTime", "", "_gimbalData", "_reticleData", "_designating"];
_gimbalData params ["_hasGimbal", "_maxGimbalX", "_maxGimbalY", "_gimbalSpeedX", "_gimbalSpeedY", "_initGimbalAngleX", "_initGimbalAngleY", "_gimbalZoomSpeedModifiers"];

if !(_enabled) exitWith {};
if !(_enabled) exitWith { objNull };

private _activeCameraNamespace = [] call CBA_fnc_createNamespace;
_activeCameraNamespace setVariable [QGVAR(fovLevels), _fovLevels];
Expand Down
1 change: 1 addition & 0 deletions addons/tagging/functions/fnc_createTag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if (_isVehicleTag) exitWith {
_object setVariable [QGVAR(hasTag), true, true];
// if (_material != "") then { _object setObjectMaterialGlobal ["clan", _material] }; // ??
["ace_tagCreated", [objNull, _texture, _object, _unit]] call CBA_fnc_globalEvent;
true
};

private _tag = createSimpleObject [_tagModel, _tagPosASL];
Expand Down
1 change: 1 addition & 0 deletions addons/tagging/functions/fnc_tag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ params [

if (isNull _unit || {_texture == ""}) exitWith {
ERROR_2("Tag parameters invalid. Unit: %1, Texture: %2",_unit,_texture);
false
};

private _isVehicleTag = false;
Expand Down
2 changes: 1 addition & 1 deletion addons/ui/functions/fnc_setAdvancedElement.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ params ["_element", "_show", ["_showHint", false, [true]], ["_force", false, [tr
_element = toLowerANSI _element;

private _cachedElement = GVAR(configCache) get _element;
if (isNil "_cachedElement") exitWith {TRACE_1("nil element",_this)};
if (isNil "_cachedElement") exitWith {TRACE_1("nil element",_this); false };

if (!_force && {!GVAR(allowSelectiveUI)}) exitWith {
TRACE_1("not allowed",_this);
Expand Down
2 changes: 2 additions & 0 deletions addons/ui/functions/fnc_setElementVisibility.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ params [

if (_source == "" || {_element == ""}) exitWith {
WARNING("Source or Element may not be empty strings!");
false
};

_element = toLowerANSI _element;

// Verify element is bound
if !(_element in GVAR(configCache)) exitWith {
WARNING_2("Element '%1' does not exist - modification by '%2' failed.",_element,_source);
false
};

private _setElement = GVAR(elementsSet) get _element;
Expand Down
2 changes: 1 addition & 1 deletion addons/vehicle_damage/functions/fnc_processHit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ switch (_hitArea) do {
case "track": {
private _damage = (0.1 max (0.1 * _addedDamage / _minDamage)) min 1;

[_vehicle, _hitPoint, _hitIndex, (_currentPartDamage + _damage) * _penChance] call FUNC(setDamage);
[_vehicle, _hitPoint, _hitIndex, (_currentPartDamage + _damage) * _penChance, _source, _instigator] call FUNC(setDamage);

TRACE_3("damaged track",_damage,_addedDamage,_minDamage);

Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/development/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ This is not the case for inline functions or functions not contained in their ow

To keep the syntax in the header consistent, we set some rules:
1. Each argument must have a type that is enclosed in brackets `<TYPE>`. The type must be in UPPERCASE.
2. Use one of the following types only: `OBJECT`, `NUMBER`, `STRING`, `BOOL`, `ARRAY`, `CONTROL`, `DISPLAY`, `CONFIG`, `CODE`, `ANY`, `LOGIC`, `SIDE`, `GROUP`, `HASHMAP`, `NAMESPACE`, `LOCATION`, `TEXT`.
2. Use one of the following types only: `OBJECT`, `NUMBER`, `STRING`, `BOOL`, `ARRAY`, `CONTROL`, `DISPLAY`, `CONFIG`, `CODE`, `ANY`, `SIDE`, `GROUP`, `HASHMAP`, `NAMESPACE`, `LOCATION`, `STRUCTUREDTEXT`, `NIL`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed logic (just object)
TEXT -> STRUCTUREDTEXT
added nil

3. If an argument can have multiple types, concatenate types using `or`. Example: `<STRING or CODE>`.
4. Arrays with the same value types are written in the format `<ARRAY of TYPEs>`. The nested type has a small `s` appended at the end.
5. If an argument is optional, the default value must be written after the type in the format `(default: value)`.
Expand Down
Loading