Ticket #4276: 1910_nearbyUnits.2.diff
File 1910_nearbyUnits.2.diff, 1.4 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Damage.js
Damage.prototype.MissileHit = function(d 130 130 // If we didn't hit the main target look for nearby units 131 131 let cmpPlayer = QueryPlayerIDInterface(data.attackerOwner); 132 132 let ents = this.EntitiesNearPoint(Vector2D.from3D(data.position), targetPosition.horizDistanceTo(data.position) * 2, cmpPlayer.GetEnemies()); 133 133 134 134 for (let ent of ents) 135 { 135 136 if (!this.TestCollision(ent, data.position, lateness)) 136 { 137 this.CauseDamage({ 138 "strengths": data.strengths, 139 "target": ent, 140 "attacker": data.attacker, 141 "multiplier": data.multiplier, 142 "type": data.type, 143 "attackerOwner": data.attackerOwner 144 }); 145 146 cmpProjectileManager.RemoveProjectile(data.projectileId); 147 break; 148 } 137 continue; 138 this.CauseDamage({ 139 "strengths": data.strengths, 140 "target": ent, 141 "attacker": data.attacker, 142 "multiplier": data.multiplier, 143 "type": data.type, 144 "attackerOwner": data.attackerOwner 145 }); 146 cmpProjectileManager.RemoveProjectile(data.projectileId); 147 } 149 148 }; 150 149 151 150 /** 152 151 * Damages units around a given origin. 153 152 * @param {Object} data - the data sent by the caller.