From 916fc11d8b0398e47561666ab15a2c9ec1a86b1d Mon Sep 17 00:00:00 2001 From: Sofia Abaied <sofab194@student.liu.se> Date: Mon, 12 Nov 2018 16:12:55 +0100 Subject: [PATCH] getTarget() returns self if no target! --- src/Unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Unit.cpp b/src/Unit.cpp index 9b30f7b..7f8b1e8 100644 --- a/src/Unit.cpp +++ b/src/Unit.cpp @@ -305,12 +305,12 @@ Unit Unit::getTarget() const //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; + CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag; //let IDAbot find the unit with this tag return m_bot->GetUnit(t_id); - } + } - return; + return m_unit; } bool Unit::isBlip() const -- GitLab