ACE3/addons/captives/functions/fnc_canSurrender.sqf

30 lines
630 B
Plaintext
Raw Normal View History

2015-02-06 21:54:26 +00:00
/*
* Author: PabstMirror
* Checks the conditions for being able to surrender
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: New Surrender State to test <BOOL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
2015-02-06 23:03:56 +00:00
* [Jean, true] call ACE_captives_fnc_canSurrender;
2015-02-06 21:54:26 +00:00
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_newSurrenderState);
private "_returnValue";
_returnValue = if (_newSurrenderState) then {
!(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering
} else {
2015-02-15 22:45:13 +00:00
(_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering
};
_returnValue