mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-22 20:12:20 +03:00
Update for A2 1.64 GetHit
Replaced vehicle sethit/setvariable method with sethit/gethit and removed setvariable "Hit_" commands for vehicles (hit_partname can now probably be added to the setvariable filters list). Modified object_getHit.sqf return to now provide the selection name in order to reduce redundant config lookups. Returns '[Damage, Part Name]', instead of just 'Damage' Modified vehicle_GetHitpoints.sqf to remove incorrect hipoints from returning. Previously this script would return all hitpoints from any vehicle the current vehicle config inherited from, even if the hitpoint didn't exist in the calling vehicle. this posed a problem since getHit on an invalid part name returns Nil
This commit is contained in:
@@ -34,12 +34,14 @@ if ("ItemToolbox" in items player && (_part in magazines player)) then {
|
||||
// Added Nutrition-Factor for work
|
||||
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
|
||||
|
||||
_damage = [_vehicle,_hitpoint] call object_getHit;
|
||||
_hits = [_vehicle,_hitpoint] call object_getHit;
|
||||
_damage = _hits select 0;
|
||||
|
||||
_vehicle removeAction _id;
|
||||
//dont waste loot on undamaged parts
|
||||
if (_damage > 0) then {
|
||||
//Fix the part
|
||||
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
|
||||
_selection = _hits select 1;
|
||||
|
||||
[_vehicle, _selection, 0, true] call fnc_veh_handleRepair;
|
||||
_vehicle setvelocity [0,0,1];
|
||||
|
||||
Reference in New Issue
Block a user