From 4ed31958642bc684425ad841f37856d743cd4629 Mon Sep 17 00:00:00 2001 From: Nikolai V Chr Date: Mon, 15 Apr 2019 20:48:02 +0200 Subject: [PATCH] fixed bug, HB-Vano found. --- BUK-M2/Nasal/damage.nas | 2 +- Frigate/Nasal/damage.nas | 2 +- depot/Nasal/damage.nas | 2 +- fleet/Nasal/damage.nas | 2 +- gci-radar/Nasal/damage.nas | 2 +- groundtarget/Nasal/damage.nas | 2 +- missile-frigate/Nasal/damage.nas | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BUK-M2/Nasal/damage.nas b/BUK-M2/Nasal/damage.nas index 071b7e8..41e9ffa 100644 --- a/BUK-M2/Nasal/damage.nas +++ b/BUK-M2/Nasal/damage.nas @@ -222,7 +222,7 @@ var incoming_listener = func { var lbs = warhead_lbs[type]; var maxDist = maxDamageDistFromWarhead(lbs); var distance = math.max(0,rand()*5-full_damage_dist_m);#being 0 to 5 meters from a bomblet on average. - var diff = maxDist-distance; + var diff = math.max(0, maxDist-distance); diff = diff * diff; var probability = diff / (maxDist*maxDist); if (use_hitpoints_instead_of_failure_modes_bool) { diff --git a/Frigate/Nasal/damage.nas b/Frigate/Nasal/damage.nas index 56c39fc..c20152b 100644 --- a/Frigate/Nasal/damage.nas +++ b/Frigate/Nasal/damage.nas @@ -222,7 +222,7 @@ var incoming_listener = func { var lbs = warhead_lbs[type]; var maxDist = maxDamageDistFromWarhead(lbs); var distance = math.max(0,rand()*5-full_damage_dist_m);#being 0 to 5 meters from a bomblet on average. - var diff = maxDist-distance; + var diff = math.max(0, maxDist-distance); diff = diff * diff; var probability = diff / (maxDist*maxDist); if (use_hitpoints_instead_of_failure_modes_bool) { diff --git a/depot/Nasal/damage.nas b/depot/Nasal/damage.nas index 415d884..d097fc5 100644 --- a/depot/Nasal/damage.nas +++ b/depot/Nasal/damage.nas @@ -222,7 +222,7 @@ var incoming_listener = func { var lbs = warhead_lbs[type]; var maxDist = maxDamageDistFromWarhead(lbs); var distance = math.max(0,rand()*5-full_damage_dist_m);#being 0 to 5 meters from a bomblet on average. - var diff = maxDist-distance; + var diff = math.max(0, maxDist-distance); diff = diff * diff; var probability = diff / (maxDist*maxDist); if (use_hitpoints_instead_of_failure_modes_bool) { diff --git a/fleet/Nasal/damage.nas b/fleet/Nasal/damage.nas index 1ae18a1..8e13fb3 100644 --- a/fleet/Nasal/damage.nas +++ b/fleet/Nasal/damage.nas @@ -222,7 +222,7 @@ var incoming_listener = func { var lbs = warhead_lbs[type]; var maxDist = maxDamageDistFromWarhead(lbs); var distance = math.max(0,rand()*5-full_damage_dist_m);#being 0 to 5 meters from a bomblet on average. - var diff = maxDist-distance; + var diff = math.max(0, maxDist-distance); diff = diff * diff; var probability = diff / (maxDist*maxDist); if (use_hitpoints_instead_of_failure_modes_bool) { diff --git a/gci-radar/Nasal/damage.nas b/gci-radar/Nasal/damage.nas index a161d96..8b21013 100644 --- a/gci-radar/Nasal/damage.nas +++ b/gci-radar/Nasal/damage.nas @@ -222,7 +222,7 @@ var incoming_listener = func { var lbs = warhead_lbs[type]; var maxDist = maxDamageDistFromWarhead(lbs); var distance = math.max(0,rand()*5-full_damage_dist_m);#being 0 to 5 meters from a bomblet on average. - var diff = maxDist-distance; + var diff = math.max(0, maxDist-distance); diff = diff * diff; var probability = diff / (maxDist*maxDist); if (use_hitpoints_instead_of_failure_modes_bool) { diff --git a/groundtarget/Nasal/damage.nas b/groundtarget/Nasal/damage.nas index 7b4aa62..e64bba9 100644 --- a/groundtarget/Nasal/damage.nas +++ b/groundtarget/Nasal/damage.nas @@ -222,7 +222,7 @@ var incoming_listener = func { var lbs = warhead_lbs[type]; var maxDist = maxDamageDistFromWarhead(lbs); var distance = math.max(0,rand()*5-full_damage_dist_m);#being 0 to 5 meters from a bomblet on average. - var diff = maxDist-distance; + var diff = math.max(0, maxDist-distance); diff = diff * diff; var probability = diff / (maxDist*maxDist); if (use_hitpoints_instead_of_failure_modes_bool) { diff --git a/missile-frigate/Nasal/damage.nas b/missile-frigate/Nasal/damage.nas index cd2b7cb..0d5ed2d 100644 --- a/missile-frigate/Nasal/damage.nas +++ b/missile-frigate/Nasal/damage.nas @@ -222,7 +222,7 @@ var incoming_listener = func { var lbs = warhead_lbs[type]; var maxDist = maxDamageDistFromWarhead(lbs); var distance = math.max(0,rand()*5-full_damage_dist_m);#being 0 to 5 meters from a bomblet on average. - var diff = maxDist-distance; + var diff = math.max(0, maxDist-distance); diff = diff * diff; var probability = diff / (maxDist*maxDist); if (use_hitpoints_instead_of_failure_modes_bool) {