Skip to content

Commit

Permalink
Increase max weapon index for large modsets (#5054)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored May 12, 2017
1 parent b8a6a60 commit 0cdb2ce
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion addons/dragging/functions/fnc_startCarry.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions addons/medical/functions/fnc_treatment_failure.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

{
Expand Down
4 changes: 2 additions & 2 deletions addons/medical/functions/fnc_treatment_success.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion addons/rearm/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down
2 changes: 1 addition & 1 deletion addons/refuel/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down
2 changes: 1 addition & 1 deletion addons/repair/functions/fnc_repair_failure.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

{
Expand Down
2 changes: 1 addition & 1 deletion addons/repair/functions/fnc_repair_success.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion addons/respawn/functions/fnc_restoreGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/safemode/functions/fnc_unlockSafety.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/weaponselect/functions/fnc_putWeaponAway.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ params ["_unit"];

_unit call EFUNC(common,fixLoweredRifleAnimation);

_unit action ["SwitchWeapon", _unit, _unit, 99];
_unit action ["SwitchWeapon", _unit, _unit, 299];
2 changes: 1 addition & 1 deletion addons/weaponselect/functions/fnc_selectWeaponMode.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0cdb2ce

Please sign in to comment.