Use claim system - fix possibility to carry while someone is sitting

This commit is contained in:
jonpas 2016-06-18 18:52:27 +02:00
parent 72092d6464
commit 2b56d0c0dd
3 changed files with 3 additions and 3 deletions

View File

@ -19,5 +19,5 @@ params ["_seat"];
// Sitting enabled, is seat object, not occupied and standing up (or not on a big slope)
GVAR(enable) &&
{isNil {_seat getVariable QGVAR(seatOccupied)}} &&
{!(_seat call EFUNC(common,owned))} &&
{round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}}

View File

@ -49,7 +49,7 @@ _player setPosASL (AGLtoASL (_seat modelToWorld _sitPosition));
// Set variables, save seat object on player
_player setVariable [QGVAR(isSitting), [_seat, _actionID]];
_seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat
[_player, _seat] call EFUNC(common,claim); // To prevent multiple people sitting on one seat
// Add automatical stand PFH in case of interruptions

View File

@ -35,4 +35,4 @@ private _animation = switch (currentWeapon _player) do {
// Set variables to nil
_player setVariable [QGVAR(isSitting), nil];
if (isNull _seat) exitWith {};
_seat setVariable [QGVAR(seatOccupied), nil, true];
[objNull, _seat] call EFUNC(common,claim);