Ticket #4276: 1910_nearbyUnits.3.diff
File 1910_nearbyUnits.3.diff, 1.5 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Damage.js
Damage.prototype.MissileHit = function(d 128 128 return; 129 129 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 let projectileHit = false; 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.attackerOwner144 });145 146 cmpProjectileManager.RemoveProjectile(data.projectileId);147 break;148 }137 continue; 138 projectileHit = true; 139 this.CauseDamage({ 140 "strengths": data.strengths, 141 "target": ent, 142 "attacker": data.attacker, 143 "multiplier": data.multiplier, 144 "type": data.type, 145 "attackerOwner": data.attackerOwner 146 }); 147 } 148 if (projectileHit) 149 cmpProjectileManager.RemoveProjectile(data.projectileId); 149 150 }; 150 151 151 152 /** 152 153 * Damages units around a given origin. 153 154 * @param {Object} data - the data sent by the caller.