Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Mirage.js
Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | for (let trader of this.traders) | ||||
cmpMarket.AddTrader(trader); | cmpMarket.AddTrader(trader); | ||||
} | } | ||||
}; | }; | ||||
// ============================ | // ============================ | ||||
Mirage.prototype.OnVisibilityChanged = function(msg) | Mirage.prototype.OnVisibilityChanged = function(msg) | ||||
{ | { | ||||
// Mirages get VIS_HIDDEN when the original entity becomes VIS_VISIBLE. | |||||
Itms: ? | |||||
if (msg.player != this.player || msg.newVisibility != VIS_HIDDEN) | if (msg.player != this.player || msg.newVisibility != VIS_HIDDEN) | ||||
return; | return; | ||||
if (this.miragedIids.has(IID_Market)) | if (this.miragedIids.has(IID_Market)) | ||||
this.UpdateTraders(msg); | this.UpdateTraders(msg); | ||||
if (this.parent == INVALID_ENTITY) | if (this.parent == INVALID_ENTITY) | ||||
Engine.DestroyEntity(this.entity); | Engine.DestroyEntity(this.entity); | ||||
else | else | ||||
Engine.PostMessage(this.entity, MT_EntityRenamed, { "entity": this.entity, "newentity": this.parent }); | Engine.PostMessage(this.entity, MT_EntityRenamed, { "entity": this.entity, "newentity": this.parent }); | ||||
}; | }; | ||||
Engine.RegisterComponentType(IID_Mirage, "Mirage", Mirage); | Engine.RegisterComponentType(IID_Mirage, "Mirage", Mirage); |
Wildfire Games · Phabricator
?