Don't use range queries for global auras. Fix related team bonus. Add Mauryan team bonus. Based on a sanderd17 patch. Reviewed by wraitti.
Differential Revision: https://code.wildfiregames.com/D19
Description
Description
Details
Details
- Auditors
elexis - Committed
fatherbushido Jan 1 2017, 5:52 PM - Differential Revision
- Restricted Differential Revision
- Parents
- rP19091: Commands.js cleanup.
- Branches
- Unknown
- Tags
- Build Status
Buildable 90 Build 146: Post-Commit Build Jenkins
Event Timeline
Comment Actions
No expectations, as contribution is entirely voluntary!
We (as in team) do have to either fix, bandage or revert this thing though before releasing, as the game should really attempt to not segfault.
I'll take a look at how to heal this too as soon as I get to it.
Comment Actions
I can revert that, I can also add some check irrelevant to that commit, but it would perhaps hide other stuff :/ So it seems I should not adress straightly the (commit) concern, but I can if needed. (Else, I was looking today at the said bug).
Comment Actions
As mentioned in the ticket, it is not clear whether this commit is responsible for the segfault, it only triggers it. I just r
At least doesn't segfault and appears to work correctly (as in alpha 21).
There is also a command to revert a specific commit, svn merge -c -REV or something.
Comment Actions
ok I cheked, it indeed occurs in that said revision.
The strange stuff is that we don't get the null cmpPlayer warning for the packing stuff.
Comment Actions
If I don't understand until tommorow, I will just revert all that and the following patch.
Comment Actions
Unpacked all siege engines on the Units demo map, no more crashes.
Proper test written revealing the crash, issue deeply buried in the engine properly fixed, side-issues noticed fixed too.
Exemplary case handling, thanks!
Comment Actions
(The author of the patch (edit: and of this line) should have done the unit tests he promised to do and never completed.)
Regression : team bonus (at least for 'template' change) are messed with diplomacy changes (with the proper amount of players)
edit: in fact not only team bonus, but all template changes (triggered when there are different players affected by the auras)
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js | ||
---|---|---|
204 | l217 or something like that |
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js | ||
---|---|---|
204 | Yeah this is applying the bonuses over and over again. |
Comment Actions
if one would want to start its dev from this rev, here is the fix:
Index: binaries/data/mods/public/simulation/components/Auras.js =================================================================== --- binaries/data/mods/public/simulation/components/Auras.js (révision 19092) +++ binaries/data/mods/public/simulation/components/Auras.js (copie de travail) @@ -201,8 +201,6 @@ if (this.IsGlobalAura(name)) { - for (let player of affectedPlayers) - { this.ApplyTemplateBonus(name, affectedPlayers); // When only Player class affected, we do not need a rangeQuery // as applicable only to player entity and templates @@ -214,8 +212,8 @@ this.ApplyBonus(name, playerEnts); } else - this.ApplyBonus(name, cmpRangeManager.GetEntitiesByPlayer(player)); - } + affectedPlayers.forEach(player => this.ApplyBonus(name, cmpRangeManager.GetEntitiesByPlayer(player))); + continue; }
(with wrong identation)