micovery / ArmA3_Wasteland.Altis

A3Wasteland is a harsh survival sandbox mission for Arma 3 where two teams and independent players fight for survival. This is a collaboration between GoT, TPG, KoS, 404Games, and others.
GNU Affero General Public License v3.0
4 stars 14 forks source link

Lock suggestion #55

Closed Cael817 closed 9 years ago

Cael817 commented 9 years ago

Not entirely sure but i think it might be better using 1 instead of 0, think i had problems before using 0. I don remember what the symptoms where however.

va_functions.sqf line 268 or so va_unlock = { _this pushBack 0; _this call va_remote_lock; };

micovery commented 9 years ago

Documentation for the lock command: https://community.bistudio.com/wiki/lock says:

0 - Unlocked
1 - Default

Which I assume means ... that 1 could be either locked, or unlocked, depending on the default value form the vehicle's config. So when using 1 there is no guarantee that the vehicle will be unlocked.

Cael817 commented 9 years ago

I believe 1 is unlocked, and i agree 0 should work fine, just remembered i had to change it, i think i got some unexpected behaviors with 0. I haven't run into anything yet so maybe we should close this and just keep it in mind?

micovery commented 9 years ago

The only problem that I could see happening is when using the locked command to determine if a vehicle is locked or not.

You have to do something like this

private["_unlocked"];
_unlocked =  ((locked _vehicle) < 2);

Maybe' that's the issue you had ...

Cael817 commented 9 years ago

Might be, was a long time ago, but i think if you check for the "locked" variable on a vehicle where you never altered the lock state, it think it returns 1. Anyway, ill close it for now =).