More tests
This commit is contained in:
parent
aee703b107
commit
9b00030039
2 changed files with 38 additions and 3 deletions
|
@ -210,9 +210,15 @@ int CTTRTSGame::AddUnit( CUnit&& unit )
|
|||
if( (pos.x >= dimentions.x) || (pos.y >= dimentions.y) )
|
||||
return 1;
|
||||
|
||||
for ( const OrderUnitPair& pair: m_OrderUnitPairs )
|
||||
{
|
||||
if( pair.unit.getPos() == unit.getPos() )
|
||||
return 2;
|
||||
}
|
||||
// Add the unit with a blank order
|
||||
m_OrderUnitPairs.push_back( OrderUnitPair(std::move(unit), COrder()) );
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue