mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #2000 from acemod/treatmentResetWeaponMode
Treatment reset weapon mode
This commit is contained in:
commit
be00f7ffe4
@ -156,7 +156,7 @@ if (_caller == _target) then {
|
||||
_callerAnim = [getText (_config >> "animationCallerSelf"), getText (_config >> "animationCallerSelfProne")] select (stance _caller == "PRONE");
|
||||
};
|
||||
|
||||
_caller setvariable [QGVAR(selectedWeaponOnTreatment), currentWeapon _caller];
|
||||
_caller setvariable [QGVAR(selectedWeaponOnTreatment), (weaponState _caller)];
|
||||
|
||||
// Cannot use secondairy weapon for animation
|
||||
if (currentWeapon _caller == secondaryWeapon _caller) then {
|
||||
|
@ -44,9 +44,14 @@ if (vehicle _caller == _caller) then {
|
||||
};
|
||||
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
|
||||
|
||||
_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]);
|
||||
if (_weaponSelect != "") then {
|
||||
_caller selectWeapon _weaponSelect;
|
||||
_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), []]);
|
||||
if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then {
|
||||
for "_index" from 0 to 99 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];
|
||||
};
|
||||
|
@ -42,9 +42,14 @@ if (vehicle _caller == _caller) then {
|
||||
};
|
||||
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
|
||||
|
||||
_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]);
|
||||
if (_weaponSelect != "") then {
|
||||
_caller selectWeapon _weaponSelect;
|
||||
_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), []]);
|
||||
if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then {
|
||||
for "_index" from 0 to 99 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];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user