From bcecb1c21d515ee210f00033d006140a860e0599 Mon Sep 17 00:00:00 2001 From: tbox1911 Date: Mon, 13 May 2024 20:17:35 +0200 Subject: [PATCH] disable sim for locked veh --- .../scripts/client/actions/action_manager_veh_check.sqf | 2 +- core.liberation/scripts/server/game/load_game_mp.sqf | 1 + core.liberation/scripts/shared/functions/F_check_near.sqf | 4 ++-- core.liberation/scripts/shared/functions/F_vehicleLock.sqf | 5 +++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core.liberation/scripts/client/actions/action_manager_veh_check.sqf b/core.liberation/scripts/client/actions/action_manager_veh_check.sqf index 472823dc1..360eff106 100644 --- a/core.liberation/scripts/client/actions/action_manager_veh_check.sqf +++ b/core.liberation/scripts/client/actions/action_manager_veh_check.sqf @@ -69,7 +69,7 @@ GRLIB_checkAction_SendArsenal = { GRLIB_checkAction_Pickup_Weapons = { params ["_target", "_unit"]; - (GRLIB_player_is_menuok && alive _target && load _target < 0.8) + (GRLIB_player_is_menuok && alive _target && load _target < 0.8 && !(_target getVariable ['R3F_LOG_disabled', false])) }; GRLIB_checkAction_UnpackInventory = { diff --git a/core.liberation/scripts/server/game/load_game_mp.sqf b/core.liberation/scripts/server/game/load_game_mp.sqf index bcf65039c..1772e9e00 100644 --- a/core.liberation/scripts/server/game/load_game_mp.sqf +++ b/core.liberation/scripts/server/game/load_game_mp.sqf @@ -249,6 +249,7 @@ if ( !isNil "_lrx_liberation_savegame" ) then { if ( _nextclass in GRLIB_vehicles_light ) then { _nextbuilding setVariable ["R3F_LOG_disabled", false, true]; + _nextbuilding enableSimulationGlobal true; if ( _nextclass in list_static_weapons ) then { _nextbuilding setVehicleLock "DEFAULT"; { _nextbuilding lockTurret [_x, false] } forEach (allTurrets _nextbuilding); diff --git a/core.liberation/scripts/shared/functions/F_check_near.sqf b/core.liberation/scripts/shared/functions/F_check_near.sqf index 81635b753..3efe7bff7 100644 --- a/core.liberation/scripts/shared/functions/F_check_near.sqf +++ b/core.liberation/scripts/shared/functions/F_check_near.sqf @@ -60,8 +60,8 @@ if (typeName (_classlist select 0) == "STRING") then { _near = _obj_list select { alive _x && getObjectType _x >= 8 && ( - isNull (_x getVariable ["R3F_LOG_est_transporte_par", objNull]) || - !(_x getVariable ['R3F_LOG_disabled', true]) + !(_x getVariable ['R3F_LOG_disabled', false]) || + !(isNull (attachedTo _x)) ) }; }; diff --git a/core.liberation/scripts/shared/functions/F_vehicleLock.sqf b/core.liberation/scripts/shared/functions/F_vehicleLock.sqf index 448fc5f69..a7afb010b 100644 --- a/core.liberation/scripts/shared/functions/F_vehicleLock.sqf +++ b/core.liberation/scripts/shared/functions/F_vehicleLock.sqf @@ -13,6 +13,7 @@ switch (_cmd) do { _vehicle setVariable ["GRLIB_counter_TTL", nil, true]; _vehicle setVariable ["GRLIB_last_killer", nil, true]; _vehicle engineOn false; + _vehicle enableSimulationGlobal false; }; case "unlock" : { _vehicle lockCargo false; @@ -21,6 +22,8 @@ switch (_cmd) do { { _vehicle lockTurret [_x, false] } forEach (allTurrets _vehicle); _vehicle setVehicleLock "UNLOCKED"; _vehicle setVariable ["R3F_LOG_disabled", false, true]; + _vehicle enableSimulationGlobal true; + {_x reveal _vehicle} forEach (units GRLIB_side_friendly); }; case "abandon" : { _vehicle lockCargo false; @@ -31,5 +34,7 @@ switch (_cmd) do { _vehicle setVariable ["R3F_LOG_disabled", false, true]; _vehicle setVariable ["GRLIB_vehicle_owner", "", true]; [_vehicle] call RPT_fnc_ResetVehicle; + _vehicle enableSimulationGlobal true; + {_x reveal _vehicle} forEach (units GRLIB_side_friendly); }; };