diff --git a/DamageCalculator/DamageCalculator/MainWindow.xaml b/DamageCalculator/DamageCalculator/MainWindow.xaml
index 2be9d6b..a49f4bc 100644
--- a/DamageCalculator/DamageCalculator/MainWindow.xaml
+++ b/DamageCalculator/DamageCalculator/MainWindow.xaml
@@ -174,6 +174,10 @@
+
+
+
+
diff --git a/DamageCalculator/DamageCalculator/MainWindow.xaml.cs b/DamageCalculator/DamageCalculator/MainWindow.xaml.cs
index b599259..1ad9146 100644
--- a/DamageCalculator/DamageCalculator/MainWindow.xaml.cs
+++ b/DamageCalculator/DamageCalculator/MainWindow.xaml.cs
@@ -406,6 +406,8 @@ namespace Damage_Calculator
this.txtBombMaxDamage.Text = this.txtBombRadius.Text = "None";
}
+ this.txtAmountBombTargets.Text = map.AmountBombTargets.ToString(); // We always count these so it will just be 0 if no targets exist
+
// Set the map's coordinates offset from the settings file in case we have a manual offset
var mapOffsetMapping = Globals.Settings.MapCoordinateOffsets.FirstOrDefault(m => m.DDSFileName == System.IO.Path.GetFileNameWithoutExtension(map.MapImagePath));
if (mapOffsetMapping != null)
@@ -440,6 +442,8 @@ namespace Damage_Calculator
// }
//
+ map.AmountBombTargets = 0; // Just make sure we're counting from 0
+
// Separate all entities, which temporarily removes curly braces from the start and/or end of entities
string[] entities = map.EntityList.Split(new string[] { "}\n{" }, StringSplitOptions.None);
for (int i = 0; i < entities.Length; i++)
@@ -473,6 +477,14 @@ namespace Damage_Calculator
}
}
+ // Check for amount of bomb sites, if available
+ if (className == "func_bomb_target")
+ {
+ // Map contains at least one bomb target, meaning it's a defusal map, so count them
+ map.AmountBombTargets++;
+ }
+
+ // Check for spawns
if (className == "info_player_terrorist" || className == "info_player_counterterrorist")
{
// Entity is spawn point
diff --git a/Shared/SteamHelpers/SteamHelpers/Models/CsgoMap.cs b/Shared/SteamHelpers/SteamHelpers/Models/CsgoMap.cs
index 313899c..596da28 100644
--- a/Shared/SteamHelpers/SteamHelpers/Models/CsgoMap.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/CsgoMap.cs
@@ -174,18 +174,30 @@ namespace Shared.Models
///
public MapCustomOverwriteMapping MapOverwrite { get; set; } = new();
+ ///
+ /// Gets whether or not there are any terrorist spawns that have
+ /// a higher priority than others.
+ ///
public bool HasPrioritySpawnsT
{
get
{
+ // If there are no spawns with higher priority,
+ // then all of them are marked as priority.
return this.AmountPrioritySpawnsT < this.AmountSpawnsT;
}
}
+ ///
+ /// Gets whether or not there are any counter-terrorist spawns that have
+ /// a higher priority than others.
+ ///
public bool HasPrioritySpawnsCT
{
get
{
+ // If there are no spawns with higher priority,
+ // then all of them are marked as priority.
return this.AmountPrioritySpawnsCT < this.AmountSpawnsCT;
}
}
@@ -216,8 +228,19 @@ namespace Shared.Models
get => this.BspFilePath != null;
}
+ ///
+ /// Gets or sets the player spawns for this map, for both teams.
+ ///
public List SpawnPoints { get; set; } = new List();
+ ///
+ /// Gets or sets the navigation mesh for bots (NAV files).
+ ///
public NavMesh? NavMesh { get; set; }
+
+ ///
+ /// Gets or sets the amount of bomb target brushes (bomb sites) for this map.
+ ///
+ public int AmountBombTargets { get; set; } = 0;
}
}