mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Increase max weapon index for large modsets (#5054)
This commit is contained in:
parent
b8a6a602f3
commit
0cdb2ce238
@ -51,7 +51,7 @@ if (_target isKindOf "CAManBase") then {
|
||||
} else {
|
||||
|
||||
// select no weapon and stop sprinting
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 99];
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 299];
|
||||
[_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation);
|
||||
|
||||
[_unit, "forceWalk", "ACE_dragging", true] call EFUNC(common,statusEffect_set);
|
||||
|
@ -41,14 +41,14 @@ _caller setVariable [QGVAR(treatmentPrevAnimCaller), nil];
|
||||
|
||||
private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnTreatment), []]);
|
||||
if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then {
|
||||
for "_index" from 0 to 99 do {
|
||||
for "_index" from 0 to 299 do {
|
||||
_caller action ["SwitchWeapon", _caller, _caller, _index];
|
||||
//Just check weapon, muzzle and mode (ignore ammo in case they were reloading)
|
||||
if (((weaponState _caller) select [0,3]) isEqualTo (_weaponSelect select [0,3])) exitWith {TRACE_1("Restoring", (weaponState _caller));};
|
||||
if ((weaponState _caller) isEqualTo ["","","","",0]) exitWith {ERROR("weaponState not found");};
|
||||
};
|
||||
} else {
|
||||
_caller action ["SwitchWeapon", _caller, _caller, 99];
|
||||
_caller action ["SwitchWeapon", _caller, _caller, 299];
|
||||
};
|
||||
|
||||
{
|
||||
|
@ -41,14 +41,14 @@ _caller setVariable [QGVAR(treatmentPrevAnimCaller), nil];
|
||||
|
||||
private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnTreatment), []]);
|
||||
if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then {
|
||||
for "_index" from 0 to 99 do {
|
||||
for "_index" from 0 to 299 do {
|
||||
_caller action ["SwitchWeapon", _caller, _caller, _index];
|
||||
//Just check weapon, muzzle and mode (ignore ammo in case they were reloading)
|
||||
if (((weaponState _caller) select [0,3]) isEqualTo (_weaponSelect select [0,3])) exitWith {TRACE_1("Restoring", (weaponState _caller));};
|
||||
if ((weaponState _caller) isEqualTo ["","","","",0]) exitWith {ERROR("weaponState not found");};
|
||||
};
|
||||
} else {
|
||||
_caller action ["SwitchWeapon", _caller, _caller, 99];
|
||||
_caller action ["SwitchWeapon", _caller, _caller, 299];
|
||||
};
|
||||
|
||||
// Record specific callback
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#define REARM_HOLSTER_WEAPON \
|
||||
_unit setVariable [QGVAR(selectedWeaponOnRearm), currentWeapon _unit]; \
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 99];
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 299];
|
||||
|
||||
#define REARM_UNHOLSTER_WEAPON \
|
||||
_weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRearm); \
|
||||
|
@ -23,7 +23,7 @@
|
||||
#define REFUEL_HOLSTER_WEAPON \
|
||||
_unit setVariable [QGVAR(selectedWeaponOnRefuel), currentWeapon _unit]; \
|
||||
_unit call EFUNC(common,fixLoweredRifleAnimation); \
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 99];
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 299];
|
||||
|
||||
#define REFUEL_UNHOLSTER_WEAPON \
|
||||
_weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRefuel); \
|
||||
|
@ -40,7 +40,7 @@ _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]);
|
||||
if (_weaponSelect != "") then {
|
||||
_caller selectWeapon _weaponSelect;
|
||||
} else {
|
||||
_caller action ["SwitchWeapon", _caller, _caller, 99];
|
||||
_caller action ["SwitchWeapon", _caller, _caller, 299];
|
||||
};
|
||||
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]);
|
||||
if (_weaponSelect != "") then {
|
||||
_caller selectWeapon _weaponSelect;
|
||||
} else {
|
||||
_caller action ["SwitchWeapon", _caller, _caller, 99];
|
||||
_caller action ["SwitchWeapon", _caller, _caller, 299];
|
||||
};
|
||||
|
||||
//Unclaim repair objects:
|
||||
|
@ -44,7 +44,7 @@ if (!isNil "_activeWeaponAndMuzzle") then {
|
||||
private _index = 0;
|
||||
|
||||
while {
|
||||
_index < 100 && {currentWeaponMode _unit != _activeWeaponMode}
|
||||
_index < 299 && {currentWeaponMode _unit != _activeWeaponMode}
|
||||
} do {
|
||||
_unit action ["SwitchWeapon", _unit, _unit, _index];
|
||||
_index = _index + 1;
|
||||
|
@ -56,7 +56,7 @@ if (inputAction "nextWeapon" > 0) then {
|
||||
// switch to last mode
|
||||
_index = 0;
|
||||
while {
|
||||
_index < 100 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}}
|
||||
_index < 299 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}}
|
||||
} do {
|
||||
_unit action ["SwitchWeapon", _unit, _unit, _index];
|
||||
_index = _index + 1;
|
||||
|
@ -19,4 +19,4 @@ params ["_unit"];
|
||||
|
||||
_unit call EFUNC(common,fixLoweredRifleAnimation);
|
||||
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 99];
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 299];
|
||||
|
@ -42,7 +42,7 @@ private _mode = _modes select _index;
|
||||
_index = 0;
|
||||
|
||||
while {
|
||||
_index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}}
|
||||
_index < 299 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}}
|
||||
} do {
|
||||
_unit action ["SwitchWeapon", _unit, _unit, _index];
|
||||
_index = _index + 1;
|
||||
|
@ -42,7 +42,7 @@ private _muzzle = _muzzles select _index;
|
||||
|
||||
_index = 0;
|
||||
while {
|
||||
_index < 100 && {currentMuzzle _unit != _muzzle}
|
||||
_index < 299 && {currentMuzzle _unit != _muzzle}
|
||||
} do {
|
||||
_unit action ["SwitchWeapon", _unit, _unit, _index];
|
||||
_index = _index + 1;
|
||||
|
@ -31,7 +31,7 @@ if (_turret isEqualTo [] && {_unit == driver _vehicle}) then {
|
||||
_index = 0;
|
||||
|
||||
while {
|
||||
_index < 100 && {currentWeapon _vehicle != _weapon}
|
||||
_index < 299 && {currentWeapon _vehicle != _weapon}
|
||||
} do {
|
||||
_unit action ["SwitchWeapon", _vehicle, _unit, _index];
|
||||
_index = _index + 1;
|
||||
@ -46,7 +46,7 @@ if (_turret isEqualTo [] && {_unit == driver _vehicle}) then {
|
||||
_index = 0;
|
||||
|
||||
while {
|
||||
_index < 100 && {_vehicle currentWeaponTurret _turret != _weapon}
|
||||
_index < 299 && {_vehicle currentWeaponTurret _turret != _weapon}
|
||||
} do {
|
||||
_unit action ["SwitchWeapon", _vehicle, _unit, _index];
|
||||
_index = _index + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user