From 07071e6ca619a53ef172ed57ec1198f6575b7a41 Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Thu, 26 Mar 2020 00:29:51 -0400 Subject: [PATCH] Hacky fix to state cloning --- src/Ecs/Components.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ecs/Components.ts b/src/Ecs/Components.ts index d773f27..a2624e0 100644 --- a/src/Ecs/Components.ts +++ b/src/Ecs/Components.ts @@ -77,8 +77,8 @@ export class Data extends CoreData { constructor(source?: Partial) { super(source); - if(source?.location) this.location = source.location.slice(); - if(source?.bounds) this.bounds = source.bounds.slice(); + if(source?.location) this.location = source.location.map(b => ({...b})); + if(source?.bounds) this.bounds = source.bounds.map(b => ({...b})); if(source?.renderBounds) this.renderBounds = copy(source.renderBounds); if(source?.renderSprite) this.renderSprite = copy(source.renderSprite); if(source?.collisionSourceClass) this.collisionSourceClass = copy(source.collisionSourceClass);