From 7a75dd339083e77e1f42092ce539a89c50bdcfa6 Mon Sep 17 00:00:00 2001
From: "Sopi (sofab194)" <trollis76@hotmail.com>
Date: Fri, 16 Nov 2018 17:20:22 +0100
Subject: [PATCH] cleaned code, replaced comments

---
 src/Unit.cpp | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/Unit.cpp b/src/Unit.cpp
index 19b627a..6dbbbca 100644
--- a/src/Unit.cpp
+++ b/src/Unit.cpp
@@ -301,19 +301,18 @@ bool Unit::isConstructing(const UnitType & type) const
 Unit Unit::getTarget() const
 {
         BOT_ASSERT(isValid(), "Unit is not valid");
-		BOT_ASSERT(hasTarget(), "Unit has no target");
+        BOT_ASSERT(hasTarget(), "Unit has no target");
 
         //if unit has order, check tag of target of first order
         if(getUnitPtr()->orders.size() > 0){
-          //pray that this value can be declared as CCUnitID
-	      CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag;
-          //let IDAbot find the unit with this tag
+          //t_id is set to the unit tag of the target
+          CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag;
+          //IDAbot finds the unit with this tag
           return m_bot->GetUnit(t_id);
-	    }
+		}
 
-		//Unit* empty_unit = new Unit();
 		Unit this_unit = Unit(m_unit, *m_bot);
-	return this_unit;
+        return this_unit;
 }
 
 bool Unit::hasTarget() const
@@ -323,7 +322,7 @@ bool Unit::hasTarget() const
 	if (getUnitPtr()->orders.size() > 0) {
 		if (getUnitPtr()->orders[0].target_unit_tag != NULL) {
 			CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag;
-			//let IDAbot find the unit with this tag
+			//IDAbot finds the unit with this tag, and returns true if valid
 			return m_bot->GetUnit(t_id).isValid();
 		}
 	}
-- 
GitLab