Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/Mirage.js
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
// ============================ | // ============================ | ||||
// Parent entity data | // Parent entity data | ||||
Mirage.prototype.CopyIdentity = function(cmpIdentity) | Mirage.prototype.CopyIdentity = function(cmpIdentity) | ||||
{ | { | ||||
this.miragedIids.add(IID_Identity); | this.miragedIids.add(IID_Identity); | ||||
// In almost all cases we want to ignore mirage entities when querying Identity components of owned entities. | // Mirages don't get identity classes via the template-filter, so that code can query | ||||
// To avoid adding a test everywhere, we don't transfer the classeslist in the template but here. | // identity components via Engine.QueryInterface without having to explicitly check for mirages. | ||||
// We clone this since the classes list is not synchronized and since the mirage should be a snapshot of the entity at the given time. | // This is cloned as otherwise we get a reference to Identity's property, | ||||
// and that array is deleted when serializing (as it's not seralized), which ends in OOS. | |||||
this.classesList = clone(cmpIdentity.GetClassesList()); | this.classesList = clone(cmpIdentity.GetClassesList()); | ||||
}; | }; | ||||
Mirage.prototype.GetClassesList = function() { return this.classesList; }; | Mirage.prototype.GetClassesList = function() { return this.classesList; }; | ||||
// Foundation data | // Foundation data | ||||
Mirage.prototype.CopyFoundation = function(cmpFoundation) | Mirage.prototype.CopyFoundation = function(cmpFoundation) | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator