forked from 0ad/0ad
Fix type errors in cmpAttack by switching parameter and object.
This was SVN commit r15805.
This commit is contained in:
parent
eda8f3cc18
commit
7ca08e2485
@ -558,7 +558,7 @@ Attack.prototype.testCollision = function(ent, point, lateness)
|
||||
if (targetShape.type === 'circle')
|
||||
{
|
||||
// Use VectorDistanceSquared and square targetShape.radius to avoid square roots.
|
||||
return (point.horizDistanceTo(targetPosition) < (targetShape.radius * targetShape.radius));
|
||||
return (targetPosition.horizDistanceTo(point) < (targetShape.radius * targetShape.radius));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -609,7 +609,7 @@ Attack.prototype.MissileHit = function(data, lateness)
|
||||
{
|
||||
// If we didn't hit the main target look for nearby units
|
||||
var cmpPlayer = Engine.QueryInterface(Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetPlayerByID(data.playerId), IID_Player)
|
||||
var ents = Damage.EntitiesNearPoint(data.position, data.position.horizDistanceTo(targetPosition) * 2, cmpPlayer.GetEnemies());
|
||||
var ents = Damage.EntitiesNearPoint(data.position, targetPosition.horizDistanceTo(data.position) * 2, cmpPlayer.GetEnemies());
|
||||
|
||||
for (var i = 0; i < ents.length; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user