From c3eaa8783be2eae4db2594f62fc078d93c6c5521 Mon Sep 17 00:00:00 2001 From: Pagwin Date: Sun, 24 Nov 2024 01:23:19 -0500 Subject: [PATCH] I keep finding issues but none of them are "the" issue --- Map.hpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Map.hpp b/Map.hpp index 7dbeef0..e5a4c06 100644 --- a/Map.hpp +++ b/Map.hpp @@ -138,12 +138,20 @@ template class Map { if (new_child) { new_child->parent = this; } - switch (dir) { case Direction::Left: - return this->left = std::move(new_child); + + this->left = std::move(new_child); + if (this->left) { + this->left->parent = this; + } + return this->left; case Direction::Right: - return this->right = std::move(new_child); + this->right = std::move(new_child); + if (this->right) { + this->right->parent = this; + } + return this->right; default: assert(false); }