Ensure captiveNum is reset for respawning unit

This commit is contained in:
PabstMirror 2015-03-26 00:53:02 -05:00
parent 91b63fbb7d
commit 811530f180
3 changed files with 34 additions and 0 deletions

View File

@ -41,3 +41,11 @@ class Extended_InitPost_EventHandlers {
};
};
};
//make sure captiveNum is reset on respawn
class Extended_Respawn_EventHandlers {
class CAManBase {
class ADDON {
respawn = QUOTE(_this call FUNC(handleRespawn));
};
};
};

View File

@ -21,6 +21,7 @@ PREP(handleGetOut);
PREP(handleKilled);
PREP(handleOnUnconscious);
PREP(handlePlayerChanged);
PREP(handleRespawn);
PREP(handleUnitInitPost);
PREP(handleZeusDisplayChanged);
PREP(moduleSurrender);

View File

@ -0,0 +1,25 @@
/*
* Author: commy2 PabstMirror
* Fix, because captiveNum doesn't reset properly on respawn
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Corpse <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [alive, body] call ACE_captives_fnc_handleRespawn;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_dead);
if (!local _unit) exitWith {};
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);