-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix freeing from jail not working at all (#68)
* Add logging for debugging what's happening * Fix freeing from prison * Log that killer was killed * Possibly fix being unable to properly free from prison * Fix cs_grad * Mark that killer has respawned * Extract release actions stuff to separate functions
- Loading branch information
Showing
14 changed files
with
137 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: 3Mydlo3 | ||
* Function initializes event handler on ACE Handcuffed event. | ||
* | ||
* Arguments: | ||
* None | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* call afsk_jail_fnc_initAceHandcuffed | ||
* | ||
* Public: No | ||
*/ | ||
|
||
[QACEGVAR(captives,setHandcuffed), { | ||
params ["_unit", "_isHandcuffed"]; | ||
if !(_unit isEqualTo player) exitWith {}; | ||
|
||
// Unit was handcuffed (arrested) | ||
if (_isHandcuffed) exitWith { | ||
[QEGVAR(killers,killerHandcuffed), [_unit]] call CBA_fnc_serverEvent; | ||
}; | ||
|
||
// If a unit was imprisoned, free it | ||
if (_unit getVariable [QGVAR(isImprisoned), false]) then { | ||
[QGVAR(free), [player]] call CBA_fnc_serverEvent; | ||
}; | ||
}] call CBA_fnc_addEventHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: 3Mydlo3 | ||
* Function initializes own implementation of release action. | ||
* | ||
* Arguments: | ||
* None | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* call afsk_jail_fnc_initReleaseAction | ||
* | ||
* Public: No | ||
*/ | ||
|
||
// Add/remove prisoner release action EH for EAST only | ||
[QGVAR(addReleaseAction), { | ||
_this call FUNC(addReleaseAction); | ||
}] call CBA_fnc_addEventHandler; | ||
[QGVAR(removeReleaseAction), { | ||
_this call FUNC(removeReleaseAction); | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
// Add own EH for release | ||
[QGVAR(released), { | ||
params ["_unit"]; | ||
if (!(_unit isEqualTo player)) exitWith {}; | ||
if (_unit getVariable [QGVAR(isImprisoned), false]) then { | ||
[QGVAR(free), [player]] call CBA_fnc_serverEvent; | ||
}; | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
// JIP compatibility for own release action | ||
{ | ||
[QGVAR(addReleaseAction), [_x]] call CBA_fnc_localEvent; | ||
} forEach GVAR(prisoners); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: 3Mydlo3 | ||
* Function initializes release event handler(s). | ||
* Exact implementation is selected depending on ACE being loaded. | ||
* | ||
* Arguments: | ||
* None | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* call afsk_jail_fnc_initReleaseEventHandler | ||
* | ||
* Public: No | ||
*/ | ||
|
||
if (EGVAR(common,ACE_Loaded)) then { | ||
call FUNC(initAceHandcuffed); | ||
} else { | ||
call FUNC(initReleaseAction); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ | |
#endif | ||
|
||
#include "\z\afsk\addons\main\script_macros.hpp" | ||
|
||
#define KILLER_UNIT_CLASS "C_man_p_fugitive_F" |