diff --git a/binaries/data/mods/public/simulation/components/Identity.js b/binaries/data/mods/public/simulation/components/Identity.js
index f2ebd7568e..b7f72a34e0 100644
a
|
b
|
Identity.prototype.Init = function()
|
92 | 92 | this.classesList = GetIdentityClasses(this.template); |
93 | 93 | this.visibleClassesList = GetVisibleIdentityClasses(this.template); |
94 | 94 | if (this.template.Phenotype) |
95 | | this.phenotype = pickRandom(this.GetPossiblePhenotypes()); |
| 95 | { |
| 96 | const phenotypes = this.GetPossiblePhenotypes(); |
| 97 | |
| 98 | // Avoid calling Math.random to avoid out of sync RNG caused by preview entities |
| 99 | this.phenotype = phenotypes[this.entity % phenotypes.length]; |
| 100 | } |
96 | 101 | else |
97 | 102 | this.phenotype = "default"; |
98 | 103 | |
diff --git a/binaries/data/mods/public/simulation/templates/special/filter/preview.xml b/binaries/data/mods/public/simulation/templates/special/filter/preview.xml
index 53984d80c9..dc07f5b76a 100644
a
|
b
|
|
2 | 2 | <Entity filtered=""> |
3 | 3 | <!-- We only want to include components which are necessary (for the visual previewing of an entity) |
4 | 4 | and safe (i.e. won't do anything that affects the synchronised simulation state), so additions |
5 | | to this list should be carefully considered --> |
| 5 | to this list should be carefully considered. |
| 6 | |
| 7 | Any Init function of any component listed here may not call Math.random, otherwise the RNG state |
| 8 | would become out of sync with the RNG state of the other clients. |
| 9 | --> |
6 | 10 | <!-- Attack is needed for the Actor Viewer and attack range overlay --> |
7 | 11 | <Attack merge=""/> |
8 | 12 | <BuildRestrictions merge=""/> |