mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Fix repair and salavage vehicles
Vehicles have to be updated directly after they got repaired and salvaged.
This commit is contained in:
@@ -52,7 +52,7 @@ if (_hasToolbox) then {
|
|||||||
/*if ((_hitpoint == "HitEngine") or (_hitpoint == "HitFuel")) then {
|
/*if ((_hitpoint == "HitEngine") or (_hitpoint == "HitFuel")) then {
|
||||||
[_vehicle, _selection, 0.89] call fnc_veh_handleDam;
|
[_vehicle, _selection, 0.89] call fnc_veh_handleDam;
|
||||||
} else {*/
|
} else {*/
|
||||||
[_vehicle, _selection, 1] call fnc_veh_handleDam;
|
[_vehicle, _selection, 1, objNull, objNull, objNull, true] call fnc_veh_handleDam;
|
||||||
//};
|
//};
|
||||||
_vehicle call fnc_veh_ResetEH;
|
_vehicle call fnc_veh_ResetEH;
|
||||||
_vehicle setvelocity [0,0,1];
|
_vehicle setvelocity [0,0,1];
|
||||||
|
|||||||
@@ -14,22 +14,23 @@ or by zombie_attack
|
|||||||
- return : updated damage for that part
|
- return : updated damage for that part
|
||||||
broadcast: boolean. if true, then the request will be sent to all players if the vehicle is not local.
|
broadcast: boolean. if true, then the request will be sent to all players if the vehicle is not local.
|
||||||
************************************************************/
|
************************************************************/
|
||||||
private["_unit","_selection","_total","_damage","_needUpdate","_totalDmg"];
|
private["_unit","_selection","_total","_damage","_needUpdate","_totalDmg","_force"];
|
||||||
|
|
||||||
_unit = _this select 0;
|
_unit = _this select 0;
|
||||||
_selection = _this select 1;
|
_selection = _this select 1;
|
||||||
_total = _this select 2;
|
_total = _this select 2;
|
||||||
_totalDmg = if (_selection != "") then {false} else {true};
|
_totalDmg = if (_selection != "") then {false} else {true};
|
||||||
|
_force = [false,true] select (count _this > 6); // Needed to force update salavage
|
||||||
|
|
||||||
if (_total >= 0.98) then {
|
if (_total >= 0.98) then {
|
||||||
_total = 1.0;
|
_total = 1.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (local _unit) then {
|
if (local _unit) then {
|
||||||
if (_total > 0) then {
|
if (_total > 0) then {
|
||||||
_unit setHit [_selection, _total];
|
_unit setHit [_selection, _total];
|
||||||
|
|
||||||
PVDZ_veh_Save = [_unit,"damage",false,_totalDmg];
|
PVDZ_veh_Save = [_unit,"damage",_force,_totalDmg];
|
||||||
if (!isServer) then {
|
if (!isServer) then {
|
||||||
publicVariableServer "PVDZ_veh_Save";
|
publicVariableServer "PVDZ_veh_Save";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ if (local _unit) then {
|
|||||||
_unit setHit [_selection, 0];
|
_unit setHit [_selection, 0];
|
||||||
_log = format["%1. setH!t[%2,0]", _log, _selection];
|
_log = format["%1. setH!t[%2,0]", _log, _selection];
|
||||||
if (!isServer) then {
|
if (!isServer) then {
|
||||||
PVDZ_veh_Save = [_unit, "repair"];
|
PVDZ_veh_Save = [_unit, "repair",true];
|
||||||
publicVariableServer "PVDZ_veh_Save";
|
publicVariableServer "PVDZ_veh_Save";
|
||||||
_log = _log + ". Requesting server hive write";
|
_log = _log + ". Requesting server hive write";
|
||||||
} else {
|
} else {
|
||||||
[_unit, "repair"] call server_updateObject;
|
[_unit, "repair",true] call server_updateObject;
|
||||||
_log = _log + ". Writing to hive";
|
_log = _log + ". Writing to hive";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user