Skip to content

Commit 35ac94b

Browse files
committed
Merge remote-tracking branch 'origin/development-feature-BetrayerHandler' into development
2 parents 5fdddef + 636f600 commit 35ac94b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

source/INIT.sqf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,23 @@ if (isMultiplayer) then {
4242
};
4343

4444
if (_revive_activated == 1) then {execVM "duws_revive\reviveInit.sqf"};
45+
4546
PlayerKilledEH = player addEventHandler ["killed", {
4647
commandpointsblu1 = commandpointsblu1 - DUWSMP_CP_death_cost;
4748
publicVariable "commandpointsblu1";
4849
}];
50+
51+
PlayerBetrayerEH = player addEventHandler ["HandleRating", {
52+
// If playerRating is negative (traitor) then reset to zero
53+
_playerRating = rating _this select 0;
54+
if (_playerRating < 0) then {
55+
player addRating (0 - _playerRating);
56+
};
57+
// If final rating is positive, do not modify, else zero.
58+
_rating = _this select 1;
59+
[0,_rating] select (_playerRating - _rating) > 0);
60+
}];
61+
4962
"support_specialized_training_available" addPublicVariableEventHandler {lbSetColor [2103, 11, [0, 1, 0, 1]];};
5063
"support_armory_available" addPublicVariableEventHandler {
5164
hq_blu1 addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];

0 commit comments

Comments
 (0)