mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Always delete metadata when destroying entities
On newly deserialized clients there is no property for the destroied entities. Because of that the metadata of the entity wasn't remembered in the event and wasn't destroied.
This commit is contained in:
parent
08340ca18a
commit
7b50e32b28
1 changed files with 6 additions and 6 deletions
|
|
@ -237,9 +237,6 @@ SharedScript.prototype.ApplyEntitiesDelta = function(state)
|
|||
|
||||
for (const evt of state.events.Destroy)
|
||||
{
|
||||
if (!this._entities.has(evt.entity))
|
||||
continue;// probably should remove the event.
|
||||
|
||||
if (foundationFinished[evt.entity])
|
||||
evt.SuccessfulFoundation = true;
|
||||
|
||||
|
|
@ -251,9 +248,12 @@ SharedScript.prototype.ApplyEntitiesDelta = function(state)
|
|||
evt.metadata[player] = this._entityMetadata[player][evt.entity];
|
||||
|
||||
const entity = this._entities.get(evt.entity);
|
||||
for (const entCol of this._entityCollections.values())
|
||||
entCol.removeEnt(entity);
|
||||
this.entities.removeEnt(entity);
|
||||
if (entity)
|
||||
{
|
||||
for (const entCol of this._entityCollections.values())
|
||||
entCol.removeEnt(entity);
|
||||
this.entities.removeEnt(entity);
|
||||
}
|
||||
|
||||
this._entities.delete(evt.entity);
|
||||
this._entitiesModifications.delete(evt.entity);
|
||||
|
|
|
|||
Loading…
Reference in a new issue