From a139e4f3bb810ac815800b09caf4830d8809b429 Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 12 Jul 2023 02:28:13 +0200 Subject: [PATCH] now initializing newly expanded world space with nullptrs --- src/corelib/world.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/world.c b/src/corelib/world.c index 47ea660..2005a73 100644 --- a/src/corelib/world.c +++ b/src/corelib/world.c @@ -22,6 +22,10 @@ int _expand_world() { printf("ERROR: failed to expand world when requesting additional objects\n"); return 0; } else { + for(size_t i = _world_objects.num; i < new_num; ++i) { + _world_objects.objects[i] = NULL; + } + _world_objects.objects = new_list; _world_objects.num = new_num; return 1;