Fix undefined color error in repair_vehicle.sqf

Same color error as f92b751 .

Also same issue in salvage_vehicle.sqf as described in #1828

Added setVariable exceptions for tank hit points.
This commit is contained in:
ebaydayz
2016-12-24 20:17:08 -05:00
parent 811e06ffe2
commit 7496ef5d5c
4 changed files with 12 additions and 8 deletions

View File

@@ -11,7 +11,8 @@
[FIXED] Tag friendly still showing after player accepts and related issue with BackpackAntiTheft. #1807 @oiad
[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 salvaging vehicles. @ebayShopper
[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

View File

@@ -17,15 +17,18 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
_configVeh = configFile >> "cfgVehicles" >> "RepairParts" >> _x;
_part = getText(_configVeh >> "part");
if ((isNil "_part") || (_part == "")) then { _part = "PartGeneric"; };
if (_part == "") then { _part = "PartGeneric"; };
// get every damaged part no matter how tiny damage is!
_damagePercent = str(round(_damage * 100))+"% Damage";
if (_damage > 0) then {
if ((_damage >= 0) and (_damage <= 0.25)) then {_color = "color='#00ff00'";}; //green
if ((_damage >= 0.26) and (_damage <= 0.50)) then {_color = "color='#ffff00'";}; //yellow
if ((_damage >= 0.51) and (_damage <= 0.75)) then {_color = "color='#ff8800'";}; //orange
if ((_damage >= 0.76) and (_damage <= 1)) then {_color = "color='#ff0000'";}; //red
_color = switch true do {
case (_damage >= 0 && _damage <= 0.25): {"color='#00ff00'"}; //green
case (_damage > 0.25 && _damage <= 0.50): {"color='#ffff00'"}; //yellow
case (_damage > 0.50 && _damage <= 0.75): {"color='#ff8800'"}; //orange
case (_damage > 0.75 && _damage <= 1): {"color='#ff0000'"}; //red
};
_cmpt = format[localize "str_actions_medical_09",_cmpt,_damagePercent];
_string = format["<t %1>%2</t>",_color,_cmpt]; //Repair - Part

View File

@@ -52,7 +52,7 @@ if (_is6WheelType) then {
_configVeh = configFile >> "cfgVehicles" >> "RepairParts" >> _x;
_part = getText(_configVeh >> "part");
if (isNil "_part") then { _part = "PartGeneric"; };
if (_part == "") then { _part = "PartGeneric"; };
//get every damaged part no matter how tiny damage is!
_damagePercent = str(round(_damage * 100))+"% Damage";

View File

@@ -3,7 +3,7 @@
5 ^USEC_!=USEC_(BloodQty|infected|injured|inPain|isCardiac|isDead|lowBlood|Sepsis)
5 ^NORRN_ !=NORRN_(LoadVcl|unconscious|unit_dragged)
5 ^bis_ !=bis_greeted(by(evil|languages|people|times)|languages|people|times) !=BIS_noCoreConversations
5 ^hit_ !=hit_(Pelvis|aimpoint|lelbow|relbow|RightFoot|LeftFoot|neck|pilot|hands|svetlo|vez|zbran) !=hit_(hands|legs) !=hit_arms !="hit_(elektronika|engine|fueltank|glass[0-9]+|karoserie|(mala|velka) vrtule|motor|munice|netrup|palivo)" !="hit_(pravy (predni|zadni) tlumic|[lp] svetlo|sklo predni [lp]|svetlo l|wheel_[12]_[1-4]_steering|wheel_[12]_damper)" !=hit_telo !="hit_\?" !="hit_(light_nav_(right|top|left|back)|light_1_(1_dir|1_pos|2_dir|2_pos)|LandLeft|LandRight|pas_l)"
5 ^hit_ !=hit_(Pelvis|aimpoint|lelbow|relbow|RightFoot|LeftFoot|neck|pilot|hands|svetlo|vez|zbran) !=hit_(hands|legs) !=hit_arms !="hit_(elektronika|engine|fueltank|glass[0-9]+|karoserie|(mala|velka) vrtule|motor|munice|netrup|palivo)" !="hit_(pravy (predni|zadni) tlumic|[lp] svetlo|sklo predni [lp]|svetlo l|wheel_[12]_[1-4]_steering|wheel_[12]_damper)" !=hit_telo !="hit_\?" !="hit_(light_nav_(right|top|left|back)|light_1_(1_dir|1_pos|2_dir|2_pos)|LandLeft|LandRight)" !="hit_(NEmotor|NEtelo|pas_L|pas_P)"
1=hit_(Pelvis|aimpoint|lelbow|relbow|RightFoot|LeftFoot|neck|pilot) // Bleeding Limbs (optional)
1=hit_(hands|legs) // Breaking Limbs (optional)
1 USEC_