Index: binaries/data/mods/public/simulation/components/Mirage.js =================================================================== --- binaries/data/mods/public/simulation/components/Mirage.js +++ binaries/data/mods/public/simulation/components/Mirage.js @@ -67,7 +67,14 @@ Mirage.prototype.CopyIdentity = function(cmpIdentity) { this.miragedIids.add(IID_Identity); - this.classesList = cmpIdentity.GetClassesList(); + // In most places (like trigger scripts and EntityLimits) we want to ignore mirages, so rather than + // including Classes in Identity in the mirage template filter and testing if entities are mirages, + // we instead add classesList to the Mirage component and then use QueryMiragedInterface when we want + // to include mirage entities and Engine.QueryInterface when we want to exclude them. + // We make a deep copy because the mirage should be a snapshot of the entity at this point in time + // rather than a reference to a potentially alterable property of another component. + // This also prevents an OOS resulting from references and values being (binary) serialized differently. + this.classesList = clone(cmpIdentity.GetClassesList()); }; Mirage.prototype.GetClassesList = function() { return this.classesList };