-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5747 from acemod/scopes-zeroing-fix
Scopes - Improved zero angle calculation
- Loading branch information
Showing
14 changed files
with
100 additions
and
22 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Author: Ruthberg | ||
* Gets the base angle of the rail on the weapon with the given weapon index | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* 1: Weapon index <NUMBER> | ||
* | ||
* Return Value: | ||
* base angle <NUMBER> | ||
* | ||
* Example: | ||
* [player, 0] call ace_scopes_fnc_getBaseAngle | ||
* | ||
* Public: Yes | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_player", "_weaponIndex"]; | ||
|
||
if (_weaponIndex < 0 || {_weaponIndex > 2}) exitWith { 0 }; | ||
|
||
private _weaponClass = [primaryWeapon _player, secondaryWeapon _player, handgunWeapon _player] select _weaponIndex; | ||
|
||
private _baseAngle = DEFAULT_RAIL_BASE_ANGLE; | ||
private _weaponConfig = configFile >> "CfgWeapons" >> _weaponClass; | ||
if (isNumber (_weaponConfig >> "ACE_RailBaseAngle")) then { | ||
_baseAngle = getNumber(_weaponConfig >> "ACE_RailBaseAngle"); | ||
}; | ||
|
||
_baseAngle |
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