Skip to content
Snippets Groups Projects
Commit 7a75dd33 authored by Sopi (sofab194)'s avatar Sopi (sofab194)
Browse files

cleaned code, replaced comments

parent deea9dde
No related merge requests found
......@@ -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();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment