mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Enabled direction randomization
This commit is contained in:
@@ -605,7 +605,7 @@ export class Map extends L.Map {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (selectedUnitTypes.length === 1 && ["GroundUnit", "NavyUnit"].includes(selectedUnitTypes[0])) {
|
else if (selectedUnitTypes.length === 1 && ["GroundUnit", "NavyUnit"].includes(selectedUnitTypes[0])) {
|
||||||
if (selectedUnits.every((unit: Unit) => { return ["AAA", "Gun Artillery", "Rocket Artillery", "Infantry", "IFV", "Tank", "Cruiser", "Destroyer", "Frigate"].includes(unit.getType()) })) {
|
if (selectedUnits.every((unit: Unit) => { return ["AAA", "APC", "Gun Artillery", "Rocket Artillery", "Infantry", "IFV", "Tank", "Cruiser", "Destroyer", "Frigate"].includes(unit.getType()) })) {
|
||||||
options["fire-at-area"] = { text: "Fire at area", tooltip: "Fire at a large area" };
|
options["fire-at-area"] = { text: "Fire at area", tooltip: "Fire at a large area" };
|
||||||
options["simulate-fire-fight"] = { text: "Simulate fire fight", tooltip: "Simulate a fire fight by shooting randomly in a certain large area" };
|
options["simulate-fire-fight"] = { text: "Simulate fire fight", tooltip: "Simulate a fire fight by shooting randomly in a certain large area" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ void GroundUnit::AIloop()
|
|||||||
case State::SIMULATE_FIRE_FIGHT: {
|
case State::SIMULATE_FIRE_FIGHT: {
|
||||||
setTask("Simulating fire fight");
|
setTask("Simulating fire fight");
|
||||||
|
|
||||||
if (!getHasTask() || 0 * (((double)(rand()) / (double)(RAND_MAX)) < 0.01)) {
|
if (!getHasTask() || (((double)(rand()) / (double)(RAND_MAX)) < 0.002)) {
|
||||||
double dist;
|
double dist;
|
||||||
double bearing1;
|
double bearing1;
|
||||||
double bearing2;
|
double bearing2;
|
||||||
@@ -183,7 +183,7 @@ void GroundUnit::AIloop()
|
|||||||
|
|
||||||
double lat = 0;
|
double lat = 0;
|
||||||
double lng = 0;
|
double lng = 0;
|
||||||
double randomBearing = bearing1 + 0 * (((double)(rand()) / (double)(RAND_MAX) - 0.5) * 2) * 15;
|
double randomBearing = bearing1 + (((double)(rand()) / (double)(RAND_MAX) - 0.5) * 2) * 15;
|
||||||
Geodesic::WGS84().Direct(position.lat, position.lng, randomBearing, r, lat, lng);
|
Geodesic::WGS84().Direct(position.lat, position.lng, randomBearing, r, lat, lng);
|
||||||
|
|
||||||
std::ostringstream taskSS;
|
std::ostringstream taskSS;
|
||||||
|
|||||||
Reference in New Issue
Block a user