From c22696f1bd96e3bd1120e8304957a39783bfded3 Mon Sep 17 00:00:00 2001
From: Rojikku98 <be.edvin@gmail.com>
Date: Fri, 8 Oct 2021 17:21:04 +0200
Subject: [PATCH] The last fix creade a new problem, hopfully this fixes the
 first and secound problem

---
 src/Unit.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Unit.cpp b/src/Unit.cpp
index 0927705..d8e4820 100644
--- a/src/Unit.cpp
+++ b/src/Unit.cpp
@@ -341,7 +341,7 @@ Unit Unit::getTarget() const
 		CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag;
 
 		// if it doesn't have a target. Return itself
-		if (m_bot->GetUnit(t_id).isValid()) {
+		if (!this->hasTarget()) {
 			return *this;
 		}
 
-- 
GitLab