From 3a7744d18da34b6fdcf87ed28d3228607327b2b1 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Fri, 6 Jan 2017 12:36:08 -0500 Subject: [PATCH] Add back 1051 handling of RepairParts not listed in config --- CHANGE LOG 1.0.6.1.txt | 3 +-- SQF/dayz_code/Configs/CfgVehicles/RepairParts.hpp | 6 ++++++ SQF/dayz_code/actions/repair_vehicle.sqf | 14 ++++++++++++-- SQF/dayz_code/actions/salvage_vehicle.sqf | 14 ++++++++++++-- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/CHANGE LOG 1.0.6.1.txt b/CHANGE LOG 1.0.6.1.txt index a1554d0cc..c65b58082 100644 --- a/CHANGE LOG 1.0.6.1.txt +++ b/CHANGE LOG 1.0.6.1.txt @@ -18,7 +18,6 @@ [FIXED] Undefined variable dayz_clientPreload error on main menu during intro.sqs. #1810 @ndavalos @ebayShopper [FIXED] Giving pain killers to another player no longer removes pain from the player giving the pain killers. [FIXED] Occasional undefined error for text color attribute when repairing and salvaging vehicles. @ebayShopper -[FIXED] Unable to repair or salvage tank tracks with scrap metal. #1828 @ndavalos [FIXED] M24 ammo prices are now 1/4 of DMR ammo prices, so no profit can be made by combining M24 rounds. @looter809 @ebayShopper [FIXED] Full cinderblock walls now work properly with vector building #1813. @DeVloek @icomrade [FIXED] Death message showing incorrectly when players suicide under certain conditions. @oiad @ebayShopper @@ -50,7 +49,7 @@ [FIXED] RU crates having zero cargo capacity and wrong classname DZ_ExplosivesBoxRU in loot table. #1852 @oiad [FIXED] Combining M24 or 2Rnd shotgun ammo can no longer be abused to dupe mags via the method described in #1848. @DeVloek [FIXED] Rapid starvation or dehydration when using chainsaw, chopping wood or pushing plane. -[FIXED] Both Merlin_HC3's can now be repaired properly by manually fixing the glass. #1856 @schwanzkopfhegel @oiad +[FIXED] Unable to repair or salvage vehicle parts not listed in the RepairParts config, like Merlin glass and tank tracks. #1828 #1856 @ndavalos @schwanzkopfhegel @oiad [NOTE] The fixes below are included in the 1.0.6 Build C server package released December 29th, 2016 (http://dayzepoch.com/a2dayzepoch.php) [FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade diff --git a/SQF/dayz_code/Configs/CfgVehicles/RepairParts.hpp b/SQF/dayz_code/Configs/CfgVehicles/RepairParts.hpp index 22b9edc44..fe08d7202 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/RepairParts.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/RepairParts.hpp @@ -126,4 +126,10 @@ class RepairParts : AllVehicles class HitHull { part = "PartGeneric"; }; + class HitLTrack { + part = "PartGeneric"; + }; + class HitRTrack { + part = "PartGeneric"; + }; }; \ No newline at end of file diff --git a/SQF/dayz_code/actions/repair_vehicle.sqf b/SQF/dayz_code/actions/repair_vehicle.sqf index 1e9863494..9edc949ae 100644 --- a/SQF/dayz_code/actions/repair_vehicle.sqf +++ b/SQF/dayz_code/actions/repair_vehicle.sqf @@ -1,4 +1,4 @@ -private ["_part","_cancel","_color","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints","_damagePercent","_configVeh"]; +private ["_part","_cancel","_color","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints","_damagePercent","_configVeh","_hitpoint"]; _vehicle = _this select 3; {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; @@ -7,6 +7,7 @@ dayz_myCursorTarget = _vehicle; _hitpoints = _vehicle call vehicle_getHitpoints; { + _hitpoint = _x; _damage = [_vehicle,_x] call object_getHit; _cmpt = toArray (_x); @@ -17,7 +18,16 @@ _hitpoints = _vehicle call vehicle_getHitpoints; _configVeh = configFile >> "cfgVehicles" >> "RepairParts" >> _x; _part = getText(_configVeh >> "part"); - if (_part == "") then { _part = "PartGeneric"; }; + if (_part == "") then { + _part = "PartGeneric"; + // Handle parts not listed in RepairParts config. + // Additional vehicle addons may be loaded with non-standard hitpoint names. + { + if ([(_x select 0),_hitpoint] call fnc_inString) then { + _part = format["Part%1",(_x select 1)]; + }; + } forEach [["Engine","Engine"],["HRotor","VRotor"],["Fuel","Fueltank"],["Wheel","Wheel"],["Glass","Glass"]]; + }; // get every damaged part no matter how tiny damage is! _damagePercent = str(round(_damage * 100))+"% Damage"; diff --git a/SQF/dayz_code/actions/salvage_vehicle.sqf b/SQF/dayz_code/actions/salvage_vehicle.sqf index 7e6f9b5a8..51ff94d5a 100644 --- a/SQF/dayz_code/actions/salvage_vehicle.sqf +++ b/SQF/dayz_code/actions/salvage_vehicle.sqf @@ -1,4 +1,4 @@ -private ["_part","_color","_vehicle","_PlayerNear","_hitpoints","_isATV","_is6WheelType","_HasNoGlassKind", +private ["_part","_color","_vehicle","_PlayerNear","_hitpoints","_isATV","_is6WheelType","_HasNoGlassKind","_hitpoint", "_6WheelTypeArray","_NoGlassArray","_NoExtraWheelsArray","_RemovedPartsArray","_damage","_cmpt","_configVeh","_damagePercent","_string","_handle","_cancel","_type"]; _vehicle = _this select 3; @@ -40,6 +40,7 @@ if (_is6WheelType) then { }; { + _hitpoint = _x; _damage = [_vehicle,_x] call object_getHit; if !(_x in _RemovedPartsArray) then { @@ -52,7 +53,16 @@ if (_is6WheelType) then { _configVeh = configFile >> "cfgVehicles" >> "RepairParts" >> _x; _part = getText(_configVeh >> "part"); - if (_part == "") then { _part = "PartGeneric"; }; + if (_part == "") then { + _part = "PartGeneric"; + // Handle parts not listed in RepairParts config. + // Additional vehicle addons may be loaded with non-standard hitpoint names. + { + if ([(_x select 0),_hitpoint] call fnc_inString) then { + _part = format["Part%1",(_x select 1)]; + }; + } forEach [["Engine","Engine"],["HRotor","VRotor"],["Fuel","Fueltank"],["Wheel","Wheel"],["Glass","Glass"]]; + }; //get every damaged part no matter how tiny damage is! _damagePercent = str(round(_damage * 100))+"% Damage";