Skip to content

Commit

Permalink
fix always true errors
Browse files Browse the repository at this point in the history
  • Loading branch information
KJeff01 committed Oct 20, 2020
1 parent 42926d4 commit 34a859b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion multiplay/skirmish/cobra_includes/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function eventAttacked(victim, attacker)
return;
}

if ((gameTime > 900000) || !highOilMap())
if ((gameTime > 420000) || !highOilMap())
{
startAttacking = true; //well, they want to play so...
}
Expand Down
12 changes: 6 additions & 6 deletions multiplay/skirmish/cobra_includes/research.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ function research()
{
if (random(100) < (highOil ? 25 : 15))
{
if (!found)
found = pursueResearch(lab, "R-Vehicle-Metals03");
found = pursueResearch(lab, "R-Vehicle-Metals03");

if (!found && !turnOffCyborgs && countStruct(CYBORG_FACTORY))
found = pursueResearch(lab, "R-Cyborg-Metals03");

Expand All @@ -226,7 +226,7 @@ function research()

if (!found && getResearch("R-Struc-Research-Upgrade04").done || (random(100) < 20))
found = evalResearch(lab, BODY_RESEARCH_1);
if (!found && getResearch("R-Struc-Research-Upgrade05").done && (random(100) < componentAvailable("Body12SUP") ? 35 : 15))
if (!found && getResearch("R-Struc-Research-Upgrade05").done && (random(100) < (componentAvailable("Body12SUP") ? 35 : 15)))
found = evalResearch(lab, BODY_RESEARCH_2);
}
}
Expand Down Expand Up @@ -273,7 +273,7 @@ function research()
if (!found && useVtol && random(100) < 70)
{
// Basic VTOL pads tried after Python.
if (!found && componentAvailable("Body11ABT") && random(100) < 70)
if (componentAvailable("Body11ABT") && random(100) < 70)
found = pursueResearch(lab, "R-Struc-VTOLPad-Upgrade01");
if (!found && componentAvailable("V-Tol") && random(100) < subPersonalities[personality].vtolPriority)
found = evalResearch(lab, VTOL_RES);
Expand Down Expand Up @@ -332,7 +332,7 @@ function research()
if (!found && useVtol && random(100) < 60)
{
// Basic VTOL pads tried after Python.
if (!found && componentAvailable("Body11ABT"))
if (componentAvailable("Body11ABT"))
found = pursueResearch(lab, "R-Struc-VTOLPad-Upgrade01");
if (!found && componentAvailable("V-Tol") && random(100) < subPersonalities[personality].vtolPriority)
found = evalResearch(lab, VTOL_RES);
Expand Down Expand Up @@ -389,7 +389,7 @@ function research()
if (!found && useVtol && random(100) < 80)
{
// Basic VTOL pads tried after Python.
if (!found && componentAvailable("Body11ABT") && random(100) < 80)
if (componentAvailable("Body11ABT") && random(100) < 80)
found = pursueResearch(lab, "R-Struc-VTOLPad-Upgrade01");
if (!found && componentAvailable("V-Tol") && (random(100) < subPersonalities[personality].vtolPriority + 10))
found = evalResearch(lab, VTOL_RES);
Expand Down
6 changes: 5 additions & 1 deletion multiplay/skirmish/cobra_includes/tactics.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ function enemyUnitsInBase()
var high = highOilMap();

if (!startAttacking &&
((gameTime > high ? 900000 : 300000) && (enemyUnits.length > high ? 20 : 8)) &&
enemyUnits[0].droidType !== DROID_CONSTRUCT &&
enemyUnits[0].droidType !== DROID_SENSOR)
{
Expand Down Expand Up @@ -660,6 +659,11 @@ function baseShuffleDefensePattern()
var x = sector.x1 + random(sector.x2);
var y = sector.y1 + random(sector.y2);

if (!propulsionCanReach("wheeled01", MY_BASE.x, MY_BASE.y, x, y))
{
return;
}

if (x <= 2)
{
x = 2;
Expand Down

0 comments on commit 34a859b

Please sign in to comment.