mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-03-01 11:11:52 +03:00
Actions cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
private ["_vehicle","_part","_hitpoint","_type","_selection","_array","_started","_finished","_animState","_isMedic","_isOK","_brokenPart","_findPercent","_damage","_hasToolbox","_nameType","_namePart"];
|
||||
private ["_array","_vehicle","_part","_hitpoint","_type","_isOK","_brokenPart","_started","_finished","_hasToolbox","_nameType","_namePart","_animState","_isMedic","_damage","_BreakableParts","_selection","_wpn","_classname","_ismelee"];
|
||||
|
||||
if (dayz_salvageInProgress) exitWith {cutText [localize "str_salvage_inprogress", "PLAIN DOWN"]; };
|
||||
if (dayz_salvageInProgress) exitWith { cutText [localize "str_salvage_inprogress", "PLAIN DOWN"]; };
|
||||
dayz_salvageInProgress = true;
|
||||
|
||||
_array = _this select 3;
|
||||
@@ -8,25 +8,21 @@ _vehicle = _array select 0;
|
||||
_part = _array select 1;
|
||||
_hitpoint = _array select 2;
|
||||
_type = typeOf _vehicle;
|
||||
|
||||
_isOK = false;
|
||||
_brokenPart = false;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
_hasToolbox = "ItemToolbox" in items player;
|
||||
|
||||
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
|
||||
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
|
||||
|
||||
{_vehicle removeAction _x} forEach s_player_repairActions;
|
||||
s_player_repairActions = [];
|
||||
{_vehicle removeAction _x} count s_player_repairActions;
|
||||
s_player_repairActions = [];
|
||||
s_player_repair_crtl = 1;
|
||||
|
||||
if (_hasToolbox) then {
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] call player_alertZombies;
|
||||
|
||||
@@ -49,11 +45,10 @@ if (_hasToolbox) then {
|
||||
|
||||
if (_finished) then {
|
||||
_damage = [_vehicle,_hitpoint] call object_getHit;
|
||||
if (_damage < 1) then {
|
||||
if (_damage < 0.10) then {
|
||||
_BreakableParts = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitLGlass","HitRGlass","HitEngine","HitFuel","HitHRotor"];
|
||||
if (_hitpoint in _BreakableParts) then {
|
||||
_findPercent = (1 - _damage) * 10;
|
||||
if(ceil (random _findPercent) == 1) then {
|
||||
if ((random 1) < 0.3) then {
|
||||
_isOK = true;
|
||||
_brokenPart = true;
|
||||
} else {
|
||||
@@ -78,9 +73,9 @@ if (_hasToolbox) then {
|
||||
_vehicle call fnc_veh_ResetEH;
|
||||
_vehicle setvelocity [0,0,1];
|
||||
if(_brokenPart) then {
|
||||
cutText [format [localize "str_salvage_destroyed",_namePart,_nameType], "PLAIN DOWN"];
|
||||
cutText [format [localize "str_salvage_destroyed",_namePart,_nameType], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format [localize "str_salvage_removed",_namePart,_nameType], "PLAIN DOWN"];
|
||||
cutText [format [localize "str_salvage_removed",_namePart,_nameType], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText [localize "str_player_24", "PLAIN DOWN"];
|
||||
@@ -100,7 +95,6 @@ if (_hasToolbox) then {
|
||||
|
||||
dayz_myCursorTarget = objNull;
|
||||
s_player_repair_crtl = -1;
|
||||
|
||||
dayz_salvageInProgress = false;
|
||||
|
||||
//adding melee mags back if needed
|
||||
@@ -109,4 +103,4 @@ _wpn = primaryWeapon player;
|
||||
_ismelee = (getNumber (configFile >> "CfgWeapons" >> _wpn >> "melee") == 1);
|
||||
if (_ismelee) then {
|
||||
call dayz_meleeMagazineCheck;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user