Skip to content

Commit

Permalink
Update fnc_canSit.sqf
Browse files Browse the repository at this point in the history
  • Loading branch information
johnb432 committed Jan 13, 2025
1 parent 9e32e7c commit d36cab7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions addons/sitting/functions/fnc_canSit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ params ["_seat", "_player", ["_seatPos", 0]];
// Sitting enabled, not occupied and standing up (or not on a big slope)
XGVAR(enable) &&
{isNil {_player getVariable QGVAR(sittingStatus)}} &&
{
{round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}} && {
private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []];
_seatsClaimed isEqualTo [] || {isNull (_seatsClaimed select _seatPos)}
} &&
{round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}}

(_seatsClaimed isEqualTo [] || {isNull (_seatsClaimed select _seatPos)}) && {
([_player, _seat] call EFUNC(common,canInteractWith)) || // not claimed (common case)
// Can self-interact and chair claimed by another sitter
{([_player, objNull] call EFUNC(common,canInteractWith)) && {(_seatsClaimed findIf {!isNull _x}) != -1}}
}
}

0 comments on commit d36cab7

Please sign in to comment.