summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2024-01-16 16:35:24 -0500
committerJonathan Bradley <jcb@pikum.xyz>2024-01-16 16:35:24 -0500
commitca516153eab089eb7797f8b2b1f8a9e2f7801d6a (patch)
treeea736c00b3ba67de2d8009544cc0446ab18ac514
parentd870e5fe0021278940810f403460ca7ec9fbae19 (diff)
level should register as entity right away and not during load process
-rw-r--r--src/game.cpp1
-rw-r--r--src/level.cpp1
2 files changed, 1 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 24b98cd..37109c5 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -435,7 +435,6 @@ void Game_LoadSceneFile(PkeLevel *level, const char *sceneFilePath) {
return;
}
memset(readLine, '\0', readLineLength);
- ECS_CreateEntity(level);
while (f.getline(readLine, readLineLength)) {
if (strcmp(PKE_FILE_OBJ_CAMERA, readLine) == 0) {
diff --git a/src/level.cpp b/src/level.cpp
index 3d6b951..499051c 100644
--- a/src/level.cpp
+++ b/src/level.cpp
@@ -31,6 +31,7 @@ LevelHandle PkeLevel_Create(const char *levelName) {
PkeLevel *lvl = PkeLevel_Get_Inner(LevelHandle_MAX);
assert(lvl != nullptr && "max level count not reached, but failed to find a valid level slot");
+ ECS_CreateEntity(lvl);
if (lvl->bkt == nullptr) {
lvl->bkt = Pke_BeginTransientBucket();