1
0
forked from 0ad/0ad

Rename "CauseSplashDamage" to the more generic "CauseDamageOverArea"

Patch By: Freagarach
Comments By: wraitii, Nescio
Differential Revision: https://code.wildfiregames.com/D2065
This was SVN commit r22486.
This commit is contained in:
bb 2019-07-16 15:14:49 +00:00
parent 7e2512a739
commit 29a8852ea4
4 changed files with 7 additions and 7 deletions

View File

@ -113,7 +113,7 @@ Damage.prototype.MissileHit = function(data, lateness)
// Do this first in case the direct hit kills the target
if (data.isSplash)
{
this.CauseSplashDamage({
this.CauseDamageOverArea({
"attacker": data.attacker,
"origin": Vector2D.from3D(data.position),
"radius": data.radius,
@ -184,7 +184,7 @@ Damage.prototype.MissileHit = function(data, lateness)
* @param {Object} data.splashBonus - The attack bonus template from the attacker.
* @param {number[]} data.playersToDamage - The array of player id's to damage.
*/
Damage.prototype.CauseSplashDamage = function(data)
Damage.prototype.CauseDamageOverArea = function(data)
{
// Get nearby entities and define variables
let nearEnts = this.EntitiesNearPoint(data.origin, data.radius, data.playersToDamage);

View File

@ -79,7 +79,7 @@ DeathDamage.prototype.CauseDeathDamage = function()
let radius = ApplyValueModificationsToEntity("DeathDamage/Range", +this.template.Range, this.entity);
cmpDamage.CauseSplashDamage({
cmpDamage.CauseDamageOverArea({
"attacker": this.entity,
"origin": pos,
"radius": radius,

View File

@ -212,7 +212,7 @@ function TestLinearSplashDamage()
}
});
cmpDamage.CauseSplashDamage(data);
cmpDamage.CauseDamageOverArea(data);
TS_ASSERT(hitEnts.has(60));
TS_ASSERT(hitEnts.has(61));
TS_ASSERT(hitEnts.has(62));
@ -228,7 +228,7 @@ function TestLinearSplashDamage()
}
});
cmpDamage.CauseSplashDamage(data);
cmpDamage.CauseDamageOverArea(data);
TS_ASSERT(hitEnts.has(60));
TS_ASSERT(hitEnts.has(61));
TS_ASSERT(hitEnts.has(62));
@ -310,7 +310,7 @@ function TestCircularSplashDamage()
}
});
cmpDamage.CauseSplashDamage({
cmpDamage.CauseDamageOverArea({
"attacker": 50,
"origin": new Vector2D(3, 4),
"radius": radius,

View File

@ -52,7 +52,7 @@ let result = {
};
AddMock(SYSTEM_ENTITY, IID_Damage, {
"CauseSplashDamage": data => TS_ASSERT_UNEVAL_EQUALS(data, result),
"CauseDamageOverArea": data => TS_ASSERT_UNEVAL_EQUALS(data, result),
"GetPlayersToDamage": (owner, friendlyFire) => playersToDamage
});