Skip to content

Commit

Permalink
replaced netId with BIS_fnc_netId
Browse files Browse the repository at this point in the history
  • Loading branch information
musurca committed May 11, 2019
1 parent 4510f4d commit b9c1e71
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ GR_TASK_MID_DELAY=40;
GR_TASK_MAX_DELAY=60;
// You can also add/remove custom event handlers to be called upon
// certain events. Adding event handlers must occur AFTER postInit
// (in other words, just add a short sleep).
[] spawn {
sleep 1;
// certain events.
// On civilian murder by player:
[yourCustomEvent_OnCivDeath] call GR_fnc_addCivDeathEventHandler; // args [_killer, _killed, _nextofkin]
// (NOTE: _nextofkin will be nil if a body delivery mission wasn't generated.)
Expand All @@ -63,7 +61,6 @@ sleep 1;
// NOTE: if your event handler uses _nextofkin or _body, make sure to turn off garbage collection with:
// _nextofkin setVariable ["GR_WILLDELETE",false];
// _body setVariable ["GR_WILLDELETE",false];
};
```

GUILT & REMEMBRANCE is licensed under [APL-SA (Arma Public License - Share-Alike)](https://www.bohemia.net/community/licenses/arma-public-license-share-alike) and is free for non-commercial use. If you add it to your server, please tell me about it — I'm interested in how this mod will be used.
Expand All @@ -78,6 +75,10 @@ For questions, comments, or bug reports, please contact me directly at nick.musu
CHANGELOG:
---------------------

v1.11 (May 10, 2019):
* hotfix: singleplayer scenarios should now work
* event handler init moved into preInit -- no need to sleep before adding them

v1.1 (May 10, 2019):
* added CBA setting to customize notification style
* civilian deaths now always add a diary record
Expand Down
9 changes: 8 additions & 1 deletion addons/GR/functions/fn_initCBA.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
fn_initCBA.sqf
by @musurca
Initializes CBA settings.
Initializes CBA settings and mission event handlers.
*/


// For storing event handlers
GR_EH_CIVDEATH = [];
GR_EH_DELIVERBODY = [];
GR_EH_CONCEALDEATH = [];

// CBA settings
GR_NOTIFY_DIARY=0;
GR_NOTIFY_SIDECHAT=1;
GR_NOTIFY_HINT=2;
Expand Down
7 changes: 1 addition & 6 deletions addons/GR/functions/fn_initServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,10 @@ if (isNil "GR_TASK_MAX_DELAY") then {
GR_TASK_OWNERS = [] call CBA_fnc_hashCreate;
GR_PLAYER_TASKS = [[],[]] call CBA_fnc_hashCreate;

// For storing event handlers
GR_EH_CIVDEATH = [];
GR_EH_DELIVERBODY = [];
GR_EH_CONCEALDEATH = [];

// trace ID of corpse
["ace_placedInBodyBag", {
params["_target","_bodybag"];
_bodybag setVariable ["CORPSE_ID",netId _target];
_bodybag setVariable ["CORPSE_ID",_target call BIS_fnc_netId];
_bodybag setVariable ["AGE",_target getVariable ["AGE",0],true]; // only broadcast AGE to clients when in the bodybag
_bodybag setVariable ["GR_NEXTOFKIN",_target getVariable ["GR_NEXTOFKIN",objNull]];
_bodybag setVariable ["GR_HIDEBODY_TASK",_target getVariable ["GR_HIDEBODY_TASK",""]];
Expand Down
4 changes: 2 additions & 2 deletions addons/GR/functions/fn_makeMissionDeliverBody.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
params["_killer", "_killed"];

_corpseId = netId _killed;
_corpseId = _killed call BIS_fnc_netId;
if (isInRemainsCollector _killed) then {
removeFromRemainsCollector [_killed];
};
Expand Down Expand Up @@ -50,7 +50,7 @@ _nextOfKin setUnitPos "up";
_nextOfKin allowFleeing 0;
doStop _nextOfKin;

_bigTask = format ["CivDead%1",netId _nextOfKin];
_bigTask = format ["CivDead%1",_nextOfKin call BIS_fnc_netId];
[side _killer,_bigTask,[format ["Deliver the body of %1 to his nearest relative.",name _killed],"Deal with Civilian Death","meet"], _nextOfKin,"CREATED",0,false,"meet"] call BIS_fnc_taskCreate;

_nextOfKin setVariable ["GR_DELIVERBODY_TASK",_bigTask];
Expand Down
2 changes: 1 addition & 1 deletion mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ overview = "Civilian deaths, reparations, and war crimes. Deliver the bodies of
author = "@musurca";
overviewText = "GR";
overviewPicture = "img\logomain.paa";
overviewFootnote = "v110";
overviewFootnote = "v111";

0 comments on commit b9c1e71

Please sign in to comment.