mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-21 23:50:48 +03:00
Toggle for salvaging from locked vehicles (#1757)
* Toggle for salvaging from locked vehicles
This adds the ability to remove salvaging from locked vehicles which
helps avoid griefing
Fixes a spelling mistake for a localization string
Makes it possible to salvage 0% damaged items again, this was disabled
as per
3292d84b85
I've had this running on my server for a year or so with no issues (not
that it doesn't affect it, i've just never seen it)
* Toggle salvagable locked vehicles changers
@ebaydayz fixed
This commit is contained in:
@@ -35,9 +35,8 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
|
||||
} forEach _hitpoints;
|
||||
|
||||
if (count _hitpoints > 0 ) then {
|
||||
//ArmA OA String
|
||||
if (count _hitpoints > 0) then {
|
||||
_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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
private ["_part","_color","_vehicle","_PlayerNear","_hitpoints","_isATV","_is6WheelType","_HasNoGlassKind",
|
||||
"_6WheelTypeArray","_NoGlassArray","_NoExtraWheelsArray","_RemovedPartsArray","_damage","_cmpt","_configVeh","_damagePercent","_string","_handle","_cancel","_type","_isBicycle"];
|
||||
"_6WheelTypeArray","_NoGlassArray","_NoExtraWheelsArray","_RemovedPartsArray","_damage","_cmpt","_configVeh","_damagePercent","_string","_handle","_cancel","_type"];
|
||||
|
||||
_vehicle = _this select 3;
|
||||
_isBicycle = _vehicle isKindOf "Bicycle";
|
||||
if (_isBicycle) exitWith {}; // No salvage for now. Bicycle wheels should not give full size tires. Also model does not update to show removed wheels.
|
||||
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
|
||||
|
||||
_PlayerNear = {isPlayer _x} count ((getPosATL _vehicle) nearEntities ["CAManBase", 10]) > 1;
|
||||
@@ -16,7 +14,7 @@ _type = typeOf _vehicle;
|
||||
_isATV = _type in ["ATV_US_EP1","ATV_CZ_EP1"];
|
||||
_is6WheelType = false;
|
||||
{if (_type isKindOf _x) exitWith {_is6WheelType = true;};} count ["Kamaz_Base","MTVR","Ural_Base","Ural_Base_withTurret","V3S_Base"];
|
||||
_HasNoGlassKind = (_vehicle isKindOf "Motorcycle") or _isBicycle;
|
||||
_HasNoGlassKind = (_vehicle isKindOf "Motorcycle");
|
||||
|
||||
_6WheelTypeArray = ["HitLMWheel","HitRMWheel"];
|
||||
_NoGlassArray = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitLGlass","HitRGlass"];
|
||||
@@ -31,7 +29,7 @@ if (_vehicle isKindOf "tractor") then {
|
||||
_hitpoints = _hitpoints - ["motor","HitLFWheel","HitRFWheel","HitLBWheel","HitRBWheel","HitLF2Wheel","HitRF2Wheel","HitLMWheel","HitRMWheel"];
|
||||
};
|
||||
|
||||
if (_isBicycle or (_vehicle isKindOf "Motocycle")) then {
|
||||
if (_vehicle isKindOf "Motocycle") then {
|
||||
_hitpoints = _hitpoints - ["HitEngine","HitFuel"];
|
||||
};
|
||||
|
||||
@@ -71,8 +69,7 @@ if (_is6WheelType) then {
|
||||
} forEach _hitpoints;
|
||||
|
||||
if (count _hitpoints > 0 ) then {
|
||||
//ArmA OA String
|
||||
_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;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user