Page MenuHomeWildfire Games

Fix missing "Damage"-node in examples.
ClosedPublic

Authored by Freagarach on Jun 17 2019, 8:25 PM.

Details

Reviewers
Nescio
bb
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22436: Add damage container also in the examples, following rP22379
Summary

With D1950 / rP22379 a "Damage"- node was introduced, we forgot to change the examples.

Test Plan

None.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Freagarach created this revision.Jun 17 2019, 8:25 PM
Freagarach edited the test plan for this revision. (Show Details)
Stan added a subscriber: Stan.Jun 17 2019, 8:28 PM

Can you fix the capitals I reported as well in this diff ?

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 532| 532| 
| 533| 533| 		let horizSpeed = +this.template[type].Projectile.Speed;
| 534| 534| 		let gravity = +this.template[type].Projectile.Gravity;
| 535|    |-		//horizSpeed /= 2; gravity /= 2; // slow it down for testing
|    | 535|+		// horizSpeed /= 2; gravity /= 2; // slow it down for testing
| 536| 536| 
| 537| 537| 		let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 538| 538| 		if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 579| 579| 		// TODO: Use unit rotation to implement x/z offsets.
| 580| 580| 		let deltaLaunchPoint = new Vector3D(0, this.template[type].Projectile.LaunchPoint["@y"], 0.0);
| 581| 581| 		let launchPoint = Vector3D.add(selfPosition, deltaLaunchPoint);
| 582|    |-		
|    | 582|+
| 583| 583| 		let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
| 584| 584| 		if (cmpVisual)
| 585| 585| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 651| 651| 			});
| 652| 652| 	}
| 653| 653| 	else
| 654|    |-	{
|    | 654|+	
| 655| 655| 		// Melee attack - hurt the target immediately
| 656| 656| 		cmpDamage.CauseDamage({
| 657| 657| 			"strengths": this.GetAttackStrengths(type),
| 661| 661| 			"type": type,
| 662| 662| 			"attackerOwner": attackerOwner
| 663| 663| 		});
| 664|    |-	}
|    | 664|+	
| 665| 665| };
| 666| 666| 
| 667| 667| /**

binaries/data/mods/public/simulation/components/Attack.js
| 522| ·»   let·cmpDamage·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_Damage);
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/Attack.js
| 626| »   »   cmpTimer.SetTimeout(SYSTEM_ENTITY,·IID_Damage,·"MissileHit",·timeToTarget·*·1000·+·+this.template[type].Delay,·data);
|    | [NORMAL] JSHintBear:
|    | Confusing plusses.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1760/display/redirect

Freagarach updated this revision to Diff 8555.Jun 19 2019, 8:16 AM
Freagarach retitled this revision from Fix missing "Damage"-node in "Attack.js" example. to Fix missing "Damage"-node in examples..
Freagarach edited the summary of this revision. (Show Details)

"DeathDamage.js".
@Stan I do not think the lowercase damage is a typo, see comment at commit.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 532| 532| 
| 533| 533| 		let horizSpeed = +this.template[type].Projectile.Speed;
| 534| 534| 		let gravity = +this.template[type].Projectile.Gravity;
| 535|    |-		//horizSpeed /= 2; gravity /= 2; // slow it down for testing
|    | 535|+		// horizSpeed /= 2; gravity /= 2; // slow it down for testing
| 536| 536| 
| 537| 537| 		let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 538| 538| 		if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 579| 579| 		// TODO: Use unit rotation to implement x/z offsets.
| 580| 580| 		let deltaLaunchPoint = new Vector3D(0, this.template[type].Projectile.LaunchPoint["@y"], 0.0);
| 581| 581| 		let launchPoint = Vector3D.add(selfPosition, deltaLaunchPoint);
| 582|    |-		
|    | 582|+
| 583| 583| 		let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
| 584| 584| 		if (cmpVisual)
| 585| 585| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 651| 651| 			});
| 652| 652| 	}
| 653| 653| 	else
| 654|    |-	{
|    | 654|+	
| 655| 655| 		// Melee attack - hurt the target immediately
| 656| 656| 		cmpDamage.CauseDamage({
| 657| 657| 			"strengths": this.GetAttackStrengths(type),
| 661| 661| 			"type": type,
| 662| 662| 			"attackerOwner": attackerOwner
| 663| 663| 		});
| 664|    |-	}
|    | 664|+	
| 665| 665| };
| 666| 666| 
| 667| 667| /**

binaries/data/mods/public/simulation/components/Attack.js
| 522| ·»   let·cmpDamage·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_Damage);
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/Attack.js
| 626| »   »   cmpTimer.SetTimeout(SYSTEM_ENTITY,·IID_Damage,·"MissileHit",·timeToTarget·*·1000·+·+this.template[type].Delay,·data);
|    | [NORMAL] JSHintBear:
|    | Confusing plusses.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1778/display/redirect

Nescio accepted this revision.Jun 19 2019, 12:51 PM
This revision is now accepted and ready to land.Jun 19 2019, 12:51 PM

Can I submit this myself? If so, would the action "Close Revision" do that?

Stan added a comment.Jun 25 2019, 4:50 PM

Can I submit this myself? If so, would the action "Close Revision" do that?

No you cannot until you have been granted commit access by the team :)

In D1995#83799, @Stan wrote:

No you cannot until you have been granted commit access by the team :)

Okay, thanks! I'll wait patiently then :)
I was not sure whether some action on my end was required, but there isn't then.

Someone (probably me) just needs to commit this.

Someone (probably me) just needs to commit this.

No hurry!

elexis edited the summary of this revision. (Show Details)Jun 26 2019, 10:39 AM
Freagarach added a reviewer: Restricted Owners Package.Jul 4 2019, 6:49 PM
bb accepted this revision.Jul 5 2019, 8:11 PM
bb added a subscriber: bb.

Lets avoid some rebasing work by committing this...

This revision was automatically updated to reflect the committed changes.
In D1995#85124, @bb wrote:

Lets avoid some rebasing work by committing this...

Thanks! :D