summaryrefslogtreecommitdiff
path: root/src/storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage.c')
-rw-r--r--src/storage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/storage.c b/src/storage.c
index b5b50ec..aa82733 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -22,7 +22,7 @@ createEntity(storage_t *this)
for (int i = 0; i < this->componentsStored; ++i)
{
component_pair_t pair = this->objects[i];
- memset(&pair.objects[idx], 0, pair.objectSize);
+ memset(&pair.objects[idx * pair.objectSize], 0, pair.objectSize);
}
return idx;
}
@@ -94,7 +94,7 @@ internal_getComponent(storage_t *this, entity_t idx, const char *name)
component_pair_t *pair = &this->objects[i];
if (strcmp(name, pair->name) == 0)
{
- return &pair->objects[idx];
+ return &pair->objects[idx * pair->objectSize];
}
}
return NULL;