mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #1094 from acemod/fixUnSurrender
Fix not being able to UnSurrender (currentWeapon)
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: PabstMirror
|
* Author: PabstMirror
|
||||||
* Checks the conditions for being able to surrender
|
* Checks the conditions for being able switch surrender states
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: caller (player) <OBJECT>
|
* 0: caller (player) <OBJECT>
|
||||||
@ -18,14 +18,14 @@
|
|||||||
|
|
||||||
PARAMS_2(_unit,_newSurrenderState);
|
PARAMS_2(_unit,_newSurrenderState);
|
||||||
|
|
||||||
if (currentWeapon _unit != "") exitWith {false};
|
|
||||||
|
|
||||||
private "_returnValue";
|
private "_returnValue";
|
||||||
|
|
||||||
_returnValue = if (_newSurrenderState) then {
|
_returnValue = if (_newSurrenderState) then {
|
||||||
!(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering
|
//no weapon equiped AND not currently surrendering and
|
||||||
|
(currentWeapon _unit == "") && {!(_unit getVariable [QGVAR(isSurrendering), false])}
|
||||||
} else {
|
} else {
|
||||||
(_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering
|
//is Surrendering
|
||||||
|
(_unit getVariable [QGVAR(isSurrendering), false])
|
||||||
};
|
};
|
||||||
|
|
||||||
_returnValue
|
_returnValue
|
||||||
|
Reference in New Issue
Block a user