mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Missile Guidance - Use weaponsInfo
to optimize fire-mode selection (#8879)
This commit is contained in:
parent
78f0262e10
commit
4eef2da0fe
@ -78,14 +78,13 @@ TRACE_4("",_currentFireMode,_nextFireMode,_index,_attackProfiles);
|
||||
|
||||
private _currentFireMode = if (_useModeForAttackProfile) then {
|
||||
TRACE_2("setting fire mode",_weaponStateToken,_nextFireMode);
|
||||
for "_weaponIndex" from 0 to 299 do {
|
||||
ACE_player action ["SwitchWeapon", _currentShooter, ACE_player, _weaponIndex];
|
||||
(weaponState _weaponStateToken) params ["_xWeapon", "", "_xMode"];
|
||||
{
|
||||
_x params ["_xIndex", "", "_xWeapon", "", "_xMode"];
|
||||
if ((_xWeapon == _weapon) && {(getText (configFile >> "CfgWeapons" >> _weapon >> _xMode >> QGVAR(attackProfile))) == _nextFireMode}) exitWith {
|
||||
TRACE_2("Restoring",_weaponIndex,weaponState _currentShooter);
|
||||
};
|
||||
if ((weaponState _weaponStateToken) isEqualTo ["","","","",0]) exitWith {ERROR_2("weaponState not found",_weapon,_nextFireMode);};
|
||||
ACE_player action ["SwitchWeapon", _currentShooter, ACE_player, _xIndex];
|
||||
TRACE_2("Restoring",weaponState _currentShooter,_x);
|
||||
};
|
||||
} forEach (ACE_player weaponsInfo [_weapon, false]);
|
||||
} else {
|
||||
TRACE_2("setVariable attackProfile",_currentShooter,_nextFireMode);
|
||||
_currentShooter setVariable [QGVAR(attackProfile), _nextFireMode, false];
|
||||
|
Loading…
Reference in New Issue
Block a user