Ticket #1910: 1910_splash_damage_broken.patch
File 1910_splash_damage_broken.patch, 1.9 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Attack.js
545 545 }; 546 546 if (this.template.Ranged.Splash) 547 547 { 548 data.friendlyFire = this.template.Ranged.Splash.FriendlyFire ;548 data.friendlyFire = this.template.Ranged.Splash.FriendlyFire != "false"; 549 549 data.radius = +this.template.Ranged.Splash.Range; 550 550 data.shape = this.template.Ranged.Splash.Shape; 551 551 data.isSplash = true; -
binaries/data/mods/public/simulation/components/Damage.js
87 87 // Do this first in case the direct hit kills the target 88 88 if (data.isSplash) 89 89 { 90 let playersToDamage = !data.friendlyFire ? QueryPlayerIDInterface(data.attackerOwner).GetEnemies() : null; 90 let playersToDamage = []; 91 if (!data.friendlyFire) 92 playersToDamage = QueryPlayerIDInterface(data.attackerOwner).GetEnemies(); 93 else 94 { 95 let numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); 96 for (let i = 0; i < numPlayers; ++i) 97 playersToDamage.push(i); 98 } 91 99 92 100 this.CauseSplashDamage({ 93 101 "attacker": data.attacker, … … 148 156 * @param {string} data.type - the type of damage. 149 157 * @param {number} data.attackerOwner - the player id of the attacker. 150 158 * @param {Vector3D} data.direction - the unit vector defining the direction. 151 * @param {number[]} [data.playersToDamage]- the array of player id's to damage.159 * @param {number[]} data.playersToDamage - the array of player id's to damage. 152 160 */ 153 161 Damage.prototype.CauseSplashDamage = function(data) 154 162 {