-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General - Remove "SwitchWeapon" spam (#10113)
* Remove "switchWeapon" spam * Update fnc_startDragLocal.sqf * Don't add invalid fire modes * Tweaks & fix
- Loading branch information
Showing
14 changed files
with
134 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,45 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: commy2 | ||
* Author: commy2, johnb43 | ||
* Get the available firing modes of a weapon. Will ignore the AI helper modes. | ||
* | ||
* Arguments: | ||
* 0: Weapon <STRING> | ||
* 1: Muzzle <STRING> (default: weapon) | ||
* | ||
* Return Value: | ||
* Firing Modes <ARRAY> | ||
* | ||
* Example: | ||
* ["gun"] call ace_common_fnc_getWeaponModes | ||
* "arifle_AK12_F" call ace_common_fnc_getWeaponModes | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_weapon", "", [""]]]; | ||
params [["_weapon", "", [""]], ["_muzzle", nil, [""]]]; | ||
|
||
private _config = configFile >> "CfgWeapons" >> _weapon; | ||
|
||
if (!isNil "_muzzle") then { | ||
_config = _config >> _muzzle | ||
}; | ||
|
||
if (!isClass _config) exitWith { | ||
[] // return | ||
}; | ||
|
||
private _modes = []; | ||
|
||
{ | ||
if (getNumber (_config >> _x >> "showToPlayer") == 1) then { | ||
_modes pushBack _x; | ||
}; | ||
|
||
if (_x == "this") then { | ||
_modes pushBack _weapon; | ||
if (_x == "this") then { | ||
_modes pushBack (configName _config); | ||
} else { | ||
if (isClass (_config >> _x)) then { | ||
_modes pushBack (configName (_config >> _x)); | ||
}; | ||
}; | ||
}; | ||
} forEach getArray (_config >> "modes"); | ||
|
||
_modes | ||
_modes // return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.