Conversation
| WARNING_1("Invalid sitting configuration of %1!",_type); | ||
| }; | ||
|
|
||
| if !((_sitPosition select 0) isEqualType []) then { |
There was a problem hiding this comment.
why not use the inverse of that and check for isEqualType Number?
There was a problem hiding this comment.
I could, doesn't make a difference here though.
| {isNil {_player getVariable QGVAR(isSitting)}} && | ||
| {!(_seat call ACEFUNC(common,owned))} && | ||
| {isNil {_player getVariable QGVAR(sittingStatus)}} && | ||
| {(_seat getVariable [QGVAR(seatsClaimed), []]) find true == -1} && |
There was a problem hiding this comment.
| {(_seat getVariable [QGVAR(seatsClaimed), []]) find true == -1} && | |
| { | |
| private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []]; | |
| _seatsClaimed isEqualTo [] | |
| || {_seatsClaimed find false > -1} | |
| } && |
I didn't test your code neither mine (will try later this day), but looks like your condition is false when any seat is claimed, so only one person would be able to multi-seat.
There was a problem hiding this comment.
Good point, I should just be checking that specific index (seat pos) or empty!
|
@Dystopian if you can give it a test that'd be great. I tested in editor with 2 units. |
addons/sitting/functions/fnc_sit.sqf
Outdated
| * | ||
| * Example: | ||
| * [seat, player] call acex_sitting_fnc_sit; | ||
| * [seat, player] call acex_sitting_fnc_sit |
There was a problem hiding this comment.
cursorObject instead of seat in all functions examples would be much more useful
There was a problem hiding this comment.
It's an object, that's all that matters, you can get it in thousands of different ways. :)
There was a problem hiding this comment.
I meant for copy-paste, just paste to debug console and hit EXEC
There was a problem hiding this comment.
having code example you can use instantly is always nice
There was a problem hiding this comment.
Good point, I am always too lazy with copy/pasting. 😆
|
tested, works perfectly (SP) |
|
@PabstMirror how? MP or SP? Which bench? |
|
@jonpas It's easily done with I think it's enough to just add |
| */ | ||
|
|
||
| params ["_seat", "_player"]; | ||
| params ["_seat", "_player", ["_seatPos", 0]]; |
There was a problem hiding this comment.
_seatPos argument should be documented in header.
|
Oh but for AI I won't add special checks, it's up to whoever calls it to also call canSeat. Or not, people find interesting use cases. :D |
Almost missed that, that's probably a good reason to add it. |
|
Land_bench_01_f, 2 players (non-dedicated) |
|
seatPos array was only getting set to true on first run |
|
Wow, I should not work on this stuff at 3am... I now remember thinking I have to add normal handling and not just first run. :D Thanks @PabstMirror ! |

When merged this pull request will: