Skip to content

Commit

Permalink
Merge pull request #3965 from acemod/fixDogtagRespawn
Browse files Browse the repository at this point in the history
Fix issue with dogtag respawn/setVariable
  • Loading branch information
nicolasbadano authored Jun 20, 2016
2 parents c47898a + 578477e commit 09fd2c4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion addons/dogtags/functions/fnc_canCheckDogtag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ params ["_player", "_target"];

if (isNull _target) exitWith {false};

!alive _target || _target getVariable ["ACE_isUnconscious", false]
(!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}
2 changes: 1 addition & 1 deletion addons/dogtags/functions/fnc_canTakeDogtag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ params ["_player", "_target"];

if (isNull _target) exitWith {false};

!alive _target || _target getVariable ["ACE_isUnconscious", false]
(!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}
2 changes: 1 addition & 1 deletion addons/dogtags/functions/fnc_checkDogtag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

params ["_player", "_target"];

private _doubleTags = !(_target getVariable [QGVAR(dogtagTaken), false]);
private _doubleTags = (_target getVariable [QGVAR(dogtagTaken), objNull]) != _target;
private _dogTagData = [_target] call FUNC(getDogTagData);

[QGVAR(showDogtag), [_dogTagData, _doubleTags]] call CBA_fnc_localEvent;
2 changes: 1 addition & 1 deletion addons/dogtags/functions/fnc_getDogtagItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private _allDogtagDatas = missionNamespace getVariable [QGVAR(allDogtagDatas), [

private _nextID = count _allDogtags + 1;

if (_nextID > 999) exitWith {};
if (_nextID > 999) exitWith {ACE_LOGERROR("Ran out of IDs");};

private _dogTagData = [_target] call FUNC(getDogTagData);
private _item = format ["ACE_dogtag_%1", _nextID];
Expand Down
4 changes: 2 additions & 2 deletions addons/dogtags/functions/fnc_takeDogtag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

params ["_player", "_target"];

if (_target getVariable [QGVAR(dogtagTaken), false]) then {
if ((_target getVariable [QGVAR(dogtagTaken), objNull]) == _target) then {
[localize LSTRING(dogtagAlreadyTaken)] call EFUNC(common,displayText);
} else {
_target setVariable [QGVAR(dogtagTaken), true, true];
_target setVariable [QGVAR(dogtagTaken), _target, true];
[QGVAR(getDogtagItem), [_player, _target]] call CBA_fnc_serverEvent;
};

0 comments on commit 09fd2c4

Please sign in to comment.