Skip to content

Commit

Permalink
Major performance fix.
Browse files Browse the repository at this point in the history
For now the beacon drops will not happen as they causes massive lag
problems. Removes a few events and fixes LasSat targets.
  • Loading branch information
KJeff01 committed Dec 12, 2017
1 parent a6df80c commit 9c60a46
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions multiplay/skirmish/cobra_includes/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,24 +263,6 @@ function eventAttacked(victim, attacker)
}
}

//Target player closest to beacon.
function eventBeacon(x, y, from, to, message)
{
if (stopExecution("throttleBeacon", 20000) || !shouldCobraAttack())
{
return;
}

if (allianceExistsBetween(from, to) || (to === from))
{
var enemyObject = enumRange(x, y, 4, ENEMIES, false)[0];
if (isDefined(enemyObject))
{
chatTactic(enemyObject.player);
}
}
}

function eventObjectTransfer(obj, from)
{
if (from !== me)
Expand All @@ -295,25 +277,6 @@ function eventObjectTransfer(obj, from)
}
}

//Increase grudge counter for closest enemy.
function eventDestroyed(object)
{
if (object.type === DROID && object.order !== DORDER_RECYCLE)
{
if (!stopExecution("throttleDestroyed", 12000))
{
addBeacon(object.x, object.y, ALLIES);
}
}

var enemies = enumRange(object.x, object.y, 5, ENEMIES, false);
var enemy = enemies[0];
if (isDefined(enemy) && enemy.player < maxPlayers && grudgeCount[enemy.player] < MAX_GRUDGE)
{
grudgeCount[enemy.player] = grudgeCount[enemy.player] + 5;
}
}

//Basic Laser Satellite support.
function eventStructureReady(structure)
{
Expand All @@ -331,7 +294,7 @@ function eventStructureReady(structure)
}
}

var fac = returnClosestEnemyFactory().reverse();
var fac = returnClosestEnemyFactory();
if (isDefined(fac))
{
activateStructure(structure, getObject(fac.typeInfo, fac.playerInfo, fac.idInfo));
Expand Down

0 comments on commit 9c60a46

Please sign in to comment.