mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Change some occurrences of BroadcastMessage where an entity id is available to use PostMessage
Patch by echotangoecho Reviewed By: O2 JS Simulation, mimo Differential Revision: https://code.wildfiregames.com/D733 This was SVN commit r20038.
This commit is contained in:
parent
ce580f0de0
commit
bcdfbd28f8
7 changed files with 7 additions and 7 deletions
|
|
@ -1004,7 +1004,7 @@ Formation.prototype.LoadFormation = function(newTemplate)
|
|||
else
|
||||
cmpNewUnitAI.MoveIntoFormation();
|
||||
|
||||
Engine.BroadcastMessage(MT_EntityRenamed, {"entity": this.entity, "newentity": newFormation});
|
||||
Engine.PostMessage(this.entity, MT_EntityRenamed, { "entity": this.entity, "newentity": newFormation });
|
||||
};
|
||||
|
||||
Engine.RegisterComponentType(IID_Formation, "Formation", Formation);
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ Foundation.prototype.Build = function(builderEnt, work)
|
|||
|
||||
Engine.PostMessage(this.entity, MT_ConstructionFinished,
|
||||
{ "entity": this.entity, "newentity": building });
|
||||
Engine.BroadcastMessage(MT_EntityRenamed, { entity: this.entity, newentity: building });
|
||||
Engine.PostMessage(this.entity, MT_EntityRenamed, { "entity": this.entity, "newentity": building });
|
||||
|
||||
Engine.DestroyEntity(this.entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ Health.prototype.Reduce = function(amount)
|
|||
{
|
||||
let resource = this.CreateCorpse(true);
|
||||
if (resource != INVALID_ENTITY)
|
||||
Engine.BroadcastMessage(MT_EntityRenamed, { entity: this.entity, newentity: resource });
|
||||
Engine.PostMessage(this.entity, MT_EntityRenamed, { "entity": this.entity, "newentity": resource });
|
||||
}
|
||||
|
||||
case "vanish":
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ Mirage.prototype.OnVisibilityChanged = function(msg)
|
|||
if (this.parent == INVALID_ENTITY)
|
||||
Engine.DestroyEntity(this.entity);
|
||||
else
|
||||
Engine.BroadcastMessage(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);
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ Promotion.prototype.Promote = function(promotedTemplateName)
|
|||
}
|
||||
}
|
||||
|
||||
Engine.BroadcastMessage(MT_EntityRenamed, { entity: this.entity, newentity: promotedUnitEntity });
|
||||
Engine.PostMessage(this.entity, MT_EntityRenamed, { "entity": this.entity, "newentity": promotedUnitEntity });
|
||||
|
||||
// Destroy current entity
|
||||
Engine.DestroyEntity(this.entity);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ SkirmishReplacer.prototype.ReplaceEntities = function()
|
|||
var cmpReplacementOwnership = Engine.QueryInterface(replacement, IID_Ownership);
|
||||
cmpReplacementOwnership.SetOwner(cmpCurOwnership.GetOwner());
|
||||
|
||||
Engine.BroadcastMessage(MT_EntityRenamed, { "entity": this.entity, "newentity": replacement });
|
||||
Engine.PostMessage(this.entity, MT_EntityRenamed, { "entity": this.entity, "newentity": replacement });
|
||||
Engine.DestroyEntity(this.entity);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ function ChangeEntityTemplate(oldEnt, newTemplate)
|
|||
|
||||
TransferGarrisonedUnits(oldEnt, newEnt);
|
||||
|
||||
Engine.BroadcastMessage(MT_EntityRenamed, { "entity": oldEnt, "newentity": newEnt });
|
||||
Engine.PostMessage(oldEnt, MT_EntityRenamed, { "entity": oldEnt, "newentity": newEnt });
|
||||
|
||||
Engine.DestroyEntity(oldEnt);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue