1
0
forked from 0ad/0ad

Fix actor being different after foundation has been built.

Reported by: @wowgetoffyourcellphone
Introduced in: 5b3bdf3647

This was SVN commit r25831.
This commit is contained in:
Stan 2021-07-20 21:51:29 +00:00
parent 72a20be1df
commit c6a9e7188e

View File

@ -337,6 +337,12 @@ Foundation.prototype.Build = function(builderEnt, work)
let building = ChangeEntityTemplate(this.entity, this.finalTemplateName);
// Make sure the foundation object is the same as the final object.
const cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
const cmpBuildingVisual = Engine.QueryInterface(building, IID_Visual);
if (cmpVisual && cmpBuildingVisual)
cmpBuildingVisual.SetActorSeed(cmpVisual.GetActorSeed());
if (cmpPlayerStatisticsTracker)
cmpPlayerStatisticsTracker.IncreaseConstructedBuildingsCounter(building);