Made ComponentPool copyable by making sure string fields are handled properly

This commit is contained in:
2016-02-18 11:37:03 +01:00
parent 0af9edc6e5
commit 97499f1c28
7 changed files with 89 additions and 48 deletions
+1
View File
@@ -48,6 +48,7 @@ ComponentWrapper World::AttachComponent(EntityID entity, const std::string& comp
ComponentWrapper c = pool->Allocate(entity);
// Write default values
memcpy(c.Data, ci.Defaults.get(), ci.Stride);
ComponentWrapper::SolidifyStrings(c);
return c;
}