RevealAttacker does what it should, attack the attacker
This commit is contained in:
parent
ae3c1b52e1
commit
7cac68c335
3 changed files with 6 additions and 16 deletions
|
@ -36,6 +36,7 @@
|
|||
<li>Future 1.19 Release<p>
|
||||
<ul>
|
||||
<li>++
|
||||
<li>RevealAttacker does what it should, attack the attacker (from Russell Smith).
|
||||
<li>DrawUnitInfo uses Resource Names instead of hard coded (from Russell Smith).
|
||||
<li>Use first races UI by default, it should be defined (from Russell Smith).
|
||||
<li>Allow victory/defeat backgrounds to not be set (from Russell Smith).
|
||||
|
|
|
@ -526,21 +526,6 @@ global void FireMissile(Unit* unit)
|
|||
// FIXME: goal is already dead, but missile could hit others?
|
||||
}
|
||||
|
||||
if( goal && RevealAttacker ) { // attacking units are seen
|
||||
Unit* target;
|
||||
// FIXME: Don't use UnitTypeByIdent during runtime.
|
||||
target = MakeUnit(UnitTypeByIdent("unit-reveal-attacker"), goal->Player);
|
||||
target->Orders[0].Action = UnitActionStill;
|
||||
target->HP = 0;
|
||||
target->X = unit->X;
|
||||
target->Y = unit->Y;
|
||||
target->TTL=GameCycle+CYCLES_PER_SECOND+CYCLES_PER_SECOND/2;
|
||||
target->CurrentSightRange=target->Stats->SightRange;
|
||||
// Little hack for the way the macro works :)
|
||||
MapMarkUnitOnBoardSight(goal,unit);
|
||||
CheckUnitToBeDrawn(target);
|
||||
}
|
||||
|
||||
//
|
||||
// None missile hits immediately!
|
||||
//
|
||||
|
|
|
@ -3325,7 +3325,11 @@ global void HitUnit(Unit* attacker,Unit* target,int damage)
|
|||
//
|
||||
if( !type->Coward ) {
|
||||
if( type->CanAttack && target->Stats->Speed ) {
|
||||
goal=AttackUnitsInReactRange(target);
|
||||
if( RevealAttacker && CanTarget(target->Type,attacker->Type)) { // Reveal Unit that is attacking
|
||||
goal=attacker;
|
||||
} else {
|
||||
goal=AttackUnitsInReactRange(target);
|
||||
}
|
||||
if( goal ) {
|
||||
if( target->SavedOrder.Action==UnitActionStill ) {
|
||||
// FIXME: should rewrite command handling
|
||||
|
|
Loading…
Add table
Reference in a new issue