diff --git a/SQF/dayz_code/actions/repair_vehicle.sqf b/SQF/dayz_code/actions/repair_vehicle.sqf index 30f4b65c9..bd6a3a6c6 100644 --- a/SQF/dayz_code/actions/repair_vehicle.sqf +++ b/SQF/dayz_code/actions/repair_vehicle.sqf @@ -1,11 +1,13 @@ private ["_part","_cancel","_color","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints","_damagePercent","_configVeh","_hitpoint","_hits"]; _vehicle = _this select 3; -{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; dayz_myCursorTarget = _vehicle; _hitpoints = _vehicle call vehicle_getHitpoints; +if (count _hitpoints < 1) exitwith {}; +{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; + { _hitpoint = _x; _hits = [_vehicle,_hitpoint] call object_getHit; @@ -49,9 +51,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints; } count _hitpoints; -if (count _hitpoints > 0) then { - // Localized in A2OA\Expansion\dta\languagecore - _cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false]; - s_player_repairActions set [count s_player_repairActions,_cancel]; - s_player_repair_crtl = 1; -}; +// Localized in A2OA\Expansion\dta\languagecore +_cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false]; +s_player_repairActions set [count s_player_repairActions,_cancel]; +s_player_repair_crtl = 1; \ No newline at end of file diff --git a/SQF/dayz_code/actions/salvage_vehicle.sqf b/SQF/dayz_code/actions/salvage_vehicle.sqf index 4432c55f5..9c95ad8da 100644 --- a/SQF/dayz_code/actions/salvage_vehicle.sqf +++ b/SQF/dayz_code/actions/salvage_vehicle.sqf @@ -2,7 +2,6 @@ private ["_isMotorcycle","_hits","_part","_color","_vehicle","_PlayerNear","_hit "_6WheelTypeArray","_NoGlassArray","_RemovedPartsArray","_damage","_cmpt","_configVeh","_damagePercent","_string","_handle","_cancel","_type"]; _vehicle = _this select 3; -{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; _PlayerNear = {isPlayer _x} count ((getPosATL _vehicle) nearEntities ["CAManBase", 12]) > 1; if (_PlayerNear) exitWith {dayz_myCursorTarget = objNull; localize "str_pickup_limit_5" call dayz_rollingMessages;}; @@ -10,6 +9,9 @@ if (_PlayerNear) exitWith {dayz_myCursorTarget = objNull; localize "str_pickup_l dayz_myCursorTarget = _vehicle; _hitpoints = _vehicle call vehicle_getHitpoints; +if (count _hitpoints < 1) exitwith {}; +{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; + _type = typeOf _vehicle; _isMotorcycle = _vehicle isKindOf "Motorcycle"; _is6WheelType = false; @@ -25,7 +27,7 @@ _NoGlassArray = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","Hi _RemovedPartsArray = ["motor","HitLF2Wheel","HitRF2Wheel","HitBody","HitMissiles","HitHull","HitVRotor","HitFuel","HitEngine"]; if (!_is6WheelType) then { - if ((_vehicle isKindOf "ATV_Base_EP1") || {_isMotorcycle}) then { + if ((_vehicle isKindOf "ATV_Base_EP1") || _isMotorcycle) then { _hitpoints = _hitpoints - _NoGlassArray; if (_isMotorcycle) then { diff --git a/SQF/dayz_code/compile/player_zombieAttack.sqf b/SQF/dayz_code/compile/player_zombieAttack.sqf index 2992d7fc3..feefad3d5 100644 --- a/SQF/dayz_code/compile/player_zombieAttack.sqf +++ b/SQF/dayz_code/compile/player_zombieAttack.sqf @@ -117,14 +117,10 @@ _zPos = getPosASL _unit; // compute damage for vehicle and/or the player if (_isVehicle) then { if ((_unit distance player) < (3.3 * 2)) then { - _hpList = _vehicle call vehicle_getHitpoints; - _hp = _hpList call BIS_fnc_selectRandom; - _wound = getText(configFile >> "cfgVehicles" >> (typeOf _vehicle) >> "HitPoints" >> _hp >> "name"); - _damage = random 0.08; - _chance = round(random 12); + _chance = round(random 12); if ((_chance % 4) == 0) then { - _openVehicles = ["ATV_Base_EP1", "Motorcycle", "Bicycle"]; + _openVehicles = ["ATV_Base_EP1", "Motorcycle", "Bicycle", "CSJ_GyroP", "CSJ_GyroC"]; { if (_vehicle isKindOf _x) exitWith { player action ["eject", _vehicle]; @@ -132,6 +128,12 @@ if (_isVehicle) then { } count _openVehicles; }; + _hpList = _vehicle call vehicle_getHitpoints; + if (count _hpList < 1) exitwith {}; + _hp = _hpList call BIS_fnc_selectRandom; + _wound = getText(configFile >> "cfgVehicles" >> (typeOf _vehicle) >> "HitPoints" >> _hp >> "name"); + _damage = random 0.08; + if (_wound in [ "glass1", "glass2", "glass3", "glass4", "glass5", "glass6" ]) then { _dam = _vehicle getHit _wound; _total = (_dam + _damage);