| 44 | } |
| 45 | |
| 46 | void UnitWrap::DecloakCheck() |
| 47 | { |
| 48 | // Ignore if not cloaked/cloakable |
| 49 | if ( !pUnit->isCloaked() || !pUnit->getType().isCloakable() ) |
| 50 | return; |
| 51 | |
| 52 | // Ignore if busy with enemy |
| 53 | if ( HasEnemyTarget() ) |
| 54 | return; |
| 55 | |
| 56 | // Ignore if auto-targetting something? |
| 57 | //if ( pUnit->AIOrderTargetUnit ) |
| 58 | // return; |
| 59 | |
| 60 | // Ignore if there's a nearby enemy unit |
| 61 | if ( pUnit->getClosestUnit(IsEnemy && CanAttack, 256) ) |
| 62 | return; |
| 63 | |
| 64 | if ( pUnit->getOrder() != Orders::NukeWait && |
| 65 | pUnit->getOrder() != Orders::NukePaint && |
| 66 | pUnit->getOrder() != Orders::NukeTrack ) |
| 67 | pUnit->decloak(); |
| 68 | } |
| 69 | |
| 70 | bool UnitWrap::DoUnitBehaviour() |
| 71 | { |
nothing calls this directly
no test coverage detected